src/Support/Http/Controllers/GraphQLController.php
public function query(GraphQLRequest $request)
    {
        $this->eventsDispatcher->dispatch(
            new StartRequest($request)
        );

        $result = $request->isBatched()
            ? $this->executeBatched($request)
            : $this->graphQL->executeRequest($request);

        $response = $this->createsResponse->createResponse($result);

        // When handling multiple requests during the application lifetime,
        // for example in tests, we need a new GraphQLRequest instance
        // for each HTTP request, so we forget the singleton here.
        $this->container->forgetInstance(GraphQLRequest::class);

        return $response;
    }
public function query(GraphQLRequest $request)
    {
        $this->eventsDispatcher->dispatch(
            new StartRequest($request)
        );

        $result = $request->isBatched()
            ? $this->executeBatched($request)
            : $this->graphQL->executeRequest($request);

        $response = $this->createsResponse->createResponse($result);

        // When handling multiple requests during the application lifetime,
        // for example in tests, we need a new GraphQLRequest instance
        // for each HTTP request, so we forget the singleton here.
        $this->container->forgetInstance(GraphQLRequest::class);

        return $response;
    }
public function query ( GraphQLRequest $ request ) { $ this -> eventsDispatcher -> dispatch ( new StartRequest ( $ request ) ) ; $ result = $ request -> isBatched ( ) ? $ this -> executeBatched ( $ request ) : $ this -> graphQL -> executeRequest ( $ request ) ; $ response = $ this -> createsResponse -> createResponse ( $ result ) ; // When handling multiple requests during the application lifetime, // for example in tests, we need a new GraphQLRequest instance // for each HTTP request, so we forget the singleton here. $ this -> container -> forgetInstance ( GraphQLRequest :: class ) ; return $ response ; }
Execute GraphQL query.

@param  \Nuwave\Lighthouse\Execution\GraphQLRequest  $request
@return \Symfony\Component\HttpFoundation\Response
Execute GraphQL query .