src/Execution/DataLoader/BatchLoader.php
public function load($key, array $metaInfo = []): Deferred
    {
        $key = $this->buildKey($key);
        $this->keys[$key] = $metaInfo;

        return new Deferred(function () use ($key) {
            if (! $this->hasLoaded) {
                $this->results = $this->resolve();
                $this->hasLoaded = true;
            }

            return $this->results[$key];
        });
    }
public function load($key, array $metaInfo = []): Deferred
    {
        $key = $this->buildKey($key);
        $this->keys[$key] = $metaInfo;

        return new Deferred(function () use ($key) {
            if (! $this->hasLoaded) {
                $this->results = $this->resolve();
                $this->hasLoaded = true;
            }

            return $this->results[$key];
        });
    }
public function load ( $ key , array $ metaInfo = [ ] ) : Deferred { $ key = $ this -> buildKey ( $ key ) ; $ this -> keys [ $ key ] = $ metaInfo ; return new Deferred ( function ( ) use ( $ key ) { if ( ! $ this -> hasLoaded ) { $ this -> results = $ this -> resolve ( ) ; $ this -> hasLoaded = true ; } return $ this -> results [ $ key ] ; } ) ; }
Load object by key.

@param  mixed  $key
@param  mixed[]  $metaInfo
@return \GraphQL\Deferred
Load object by key .