Skip to content

Commit

Permalink
fix: generate Query and Mutation mocks
Browse files Browse the repository at this point in the history
While these types should not be used very often, it can
happen another mock references a `Query` or `Mutation` type.
Which means we'll declare a property value with `aQuery` or
`aMutation`

That's why we need to define those types

Fixes #42
  • Loading branch information
ardeois committed Sep 7, 2021
1 parent 7a937eb commit ba5d0cb
Show file tree
Hide file tree
Showing 3 changed files with 338 additions and 14 deletions.
4 changes: 0 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,6 @@ export const plugin: PluginFunction<TypescriptMocksPluginConfig> = (schema, docu
// This function triggered per each type
const typeName = node.name.value;

if (typeName === 'Query' || typeName === 'Mutation') {
return null;
}

const { fields } = node;
return {
typeName,
Expand Down
Loading

0 comments on commit ba5d0cb

Please sign in to comment.