Closed alobodig closed 4 years ago
This will allow the GraphQL context to be available to the services.
Here is an example use case which will pass user information from a request handled by graphqlHTTP to a service.
app.use('/graphql', graphqlHTTP((request, response) => ({ schema: gateway.schema, context: { user: request.user }, })));
Then in a service:
const GraphQLMixin = createGraphqlMixin({ typeName: 'Example', schema, resolvers: { Query: { async example(_, {}, context, info) { console.log(context.params.graphqlContext.user); // this is now available }, }, }, });
This will allow the GraphQL context to be available to the services.
Here is an example use case which will pass user information from a request handled by graphqlHTTP to a service.
Then in a service: