Closed caioflores closed 5 years ago
Following this discussion: https://github.com/mickhansen/graphql-sequelize/issues/656
The example server of dataloader with graph-yoga is not working anymore with dataloader-sequelize 2.0.0: https://github.com/mickhansen/graphql-sequelize/blob/master/examples/graphql-yoga/src/server.js
The new way to make it work as @intellix solved is:
schema.context = req => { const dataloaderContext = createContext(sequelize); resolver.contextToOptions = { dataloaderContext: [EXPECTED_OPTIONS_KEY] }; return { ...req, dataloaderContext }; };
I'll open a PR to update README and example.
Solved the problem here #671
Will discuss in PR.
Following this discussion: https://github.com/mickhansen/graphql-sequelize/issues/656
The example server of dataloader with graph-yoga is not working anymore with dataloader-sequelize 2.0.0: https://github.com/mickhansen/graphql-sequelize/blob/master/examples/graphql-yoga/src/server.js
The new way to make it work as @intellix solved is:
I'll open a PR to update README and example.