We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying follow the official doc to use data source in my resolvers. However, there's no field name dataSources exists on context.
dataSources
context
I am wondering if the dataSources is acceptable when I try to register the plugin?
const resolvers = { Query: { product: async (_source: any, args: any, context: any) => { console.log(args) console.log(context) // no dataSources in the context return { id: 1 } } }, };
server.register(graphqlFastify, { prefix: '/graphql', graphql: { schema, dataSources: () => { console.log('The log doesn\'t print') return { productAPI: new ProductAPI(), }; }, context: () => { return { token: 'foo', }; }, tracing: true, cacheControl: { defaultMaxAge: 500, stripFormattedExtensions: false, calculateCacheControlHeaders: false, }, cache: new RedisCache({ host: '127.0.0.1' }) }, });
https://www.apollographql.com/docs/apollo-server/features/data-sources.html
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am trying follow the official doc to use data source in my resolvers.
However, there's no field name
dataSources
exists oncontext
.I am wondering if the
dataSources
is acceptable when I try to register the plugin?https://www.apollographql.com/docs/apollo-server/features/data-sources.html
The text was updated successfully, but these errors were encountered: