You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Testkit not executing query (or mutations) using testkit.execute()
Problem
I'm having issues with testkit even running resolvers. Like a todo app:
constapp=testkit.testModule(todosGraphqlModule);expect(app.schema.getQueryType()).toBeDefined();expect(app.schema.getMutationType()).toBeDefined();constgraphResult=awaittestkit.execute(app,{document: gql` query getTodo($id: ID!) { id title } `,variableValues: {id: 'someId',},});console.log(graphResult);// output is: { data {}}
Seems pretty simple. If I run the code in my app, the resolvers run as expected. But running this in Jest I always get { data {} } as a result, and the resolvers are never executed.
Testkit not executing query (or mutations) using
testkit.execute()
Problem
I'm having issues with testkit even running resolvers. Like a todo app:
Seems pretty simple. If I run the code in my app, the resolvers run as expected. But running this in Jest I always get { data {} } as a result, and the resolvers are never executed.
Reproduceable problem
Stackblitz
https://stackblitz.com/edit/node-mnkhc1?file=src/modules/users/users.module.spec.ts
Example repo
https://github.com/Brian-McBride/graphql-modules-testing-example
The schema link
The module link
The test is here:
Expected behavior
The response from the test should run the query and return its value.
Environment:
"graphql-modules": "^2.1.0",
:The text was updated successfully, but these errors were encountered: