youshido-php / GraphQLBundle

Pure PHP implementation of GraphQL Server – Symfony Bundle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple Endpoints

BowlingX opened this issue · comments

Is it possible to support multiple endpoints with different schemas in a single Application?
I think this is similar to #14. Composing a schema can be solved already with DI tags and manual merging in the schema class, but independent endpoints for multiple bundles in the same symfony application is not possible right now.

Yes you can, I don't know if it's the right way to do it but it works for me:

/**
 * @Route("/graphql/public")
 */
public function graphqlPublicAction(Request $request)
{
    $this->container->set('graphql.schema', new PublicSchema());
    return $this->forward('GraphQLBundle:GraphQL:default', [], $request->request->all());
}