graphql-mesh icon indicating copy to clipboard operation
graphql-mesh copied to clipboard

Validate the operation documents against the schema

Open ardatan opened this issue 1 year ago • 0 comments

We can use validate as it is but we need to consider the custom validation rules etc that user might be using.

Right now if the document has a field that is not available in the schema. They get the following error;

💥 🕸️  Mesh TypeError: Cannot read properties of undefined (reading 'name')
    at /home/ardat_000/Guild/graphql-mesh/node_modules/graphql/type/introspection.js:616:53
    at Array.some (<anonymous>)
    at Object.isIntrospectionType (/home/ardat_000/Guild/graphql-mesh/node_modules/graphql/type/introspection.js:616:29)
    at Object.Field (/home/ardat_000/Guild/graphql-mesh/node_modules/@graphql-codegen/typescript/index.js:425:25)
    at Object.enter (/home/ardat_000/Guild/graphql-mesh/node_modules/graphql/utilities/TypeInfo.js:391:27)
    at Object.visit (/home/ardat_000/Guild/graphql-mesh/node_modules/graphql/language/visitor.js:197:21)
    at /home/ardat_000/Guild/graphql-mesh/node_modules/@graphql-codegen/typescript/index.js:430:38
    at Array.forEach (<anonymous>)
    at includeIntrospectionTypesDefinitions (/home/ardat_000/Guild/graphql-mesh/node_modules/@graphql-codegen/typescript/index.js:430:15)
    at Object.plugin (/home/ardat_000/Guild/graphql-mesh/node_modules/@graphql-codegen/typescript/index.js:399:38)

ardatan avatar Jul 05 '22 14:07 ardatan