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
1 I have graphQL schema defined in the file.
2 I saw your example, in my project they are using a huge query, I gave the sample at the bottom. Not the exact query. If you can share something huge query and schema that working code. It really helps. I have very little knowledge of Graphql.
3 I tried code as mentioned below but it is not able to intercept the request. I am not getting any errors.
I am using a test cafe in my project. Due to multiple graphQL requests to build a report, I thought to use your solution. I have looked your another example- https://github.com/abhinaba-ghosh/graphql-mock-e2e-example
1 I have graphQL schema defined in the file.
2 I saw your example, in my project they are using a huge query, I gave the sample at the bottom. Not the exact query. If you can share something huge query and schema that working code. It really helps. I have very little knowledge of Graphql.
3 I tried code as mentioned below but it is not able to intercept the request. I am not getting any errors.
1 const mock = {
Query: () => ({
data: ({ storeId }) => ,
}),
};
2 const query = `
query getReport($A: String!, $B: String, $C: Int, $D: Int) {
getReport($A: String!, $B: String, $C: Int, $D: Int) {
}
`
const requestMock = RequestMock()
.onRequestTo({ url: 'https:///graphql', method: 'POST' })
.respond(async (req, res) => {
await mockGraphQL(
{
schema: graphQLSchemaFromFile(
${process.cwd()}/data/scanReport/queries/mySchema.graphql
),
mock,
},
req,
res
)
}, 200, {
'content-type': 'application/json',
'access-control-allow-credentials': true,
'access-control-allow-origin': '',
})
The text was updated successfully, but these errors were encountered: