Issue workflow progress
Progress of the issue based on the
Contributor Workflow
Describe the bug
When comparing two identical schemas featuring a @deprecated field, graphql-inspector diff falsely detects the @deprecated directive as being an addition when it is unchanged.
This seems to be specifically when comparing a typeDef string to an HTTP endpoint.
There is no difference in output between these two commands:
pnpm exec graphql-inspector introspect ./scripts/makeGraphQLSchema.ts --require ts-node/register
pnpm exec graphql-inspector introspect https://my-prod-env/graphql
Confirming I think that this is an actual bug in the diff algo and not environmental
I also cannot reproduce if I diff using HTTP for both old and new. In this case I get no changes detected
To Reproduce Steps to reproduce the behavior:
pnpm exec graphql-inspector diff https://my-prod-env/graphql ./scripts/makeGraphQLSchema.ts --require ts-node/register
Output:
Detected the following changes (1) between schemas:
✔ Directive deprecated was added to field Mutation.raiseAdditionalWorkRequestForEvent
success No breaking changes detected
Expected behavior
No difference in schema.
Environment:
- OS:
@graphql-inspector/cli: 5.0.8
graphql: 16.10.0 (and 16.8.1, I tried upgrading)
- NodeJS: v20.16.0
Additional context
Contents of my script:
// ./scripts/makeGraphQLSchema.ts
import { makeExecutableSchema } from '@graphql-tools/schema';
import {
HexColorCodeResolver as Colour,
DateResolver as Date,
DateTimeResolver as DateTime,
JSONObjectResolver as JSONObject,
TimeResolver as Time,
TimeZoneResolver as TimeZone,
} from 'graphql-scalars';
import typeDefs from './typeDefs';
const resolvers = {
Date,
DateTime,
Time,
TimeZone,
Colour,
JSONObject,
};
export default makeExecutableSchema({ typeDefs, resolvers });
We use GraphQL codegen to combine a bunch of *.graphql definitions into a single typeDef. We version control the generated typeDef though so I can say with confidence that it does contain the @deprecated field.
Issue workflow progress
Progress of the issue based on the
Contributor Workflow
Describe the bug
When comparing two identical schemas featuring a
@deprecatedfield, graphql-inspector diff falsely detects the@deprecateddirective as being an addition when it is unchanged.This seems to be specifically when comparing a typeDef string to an HTTP endpoint.
There is no difference in output between these two commands:
pnpm exec graphql-inspector introspect ./scripts/makeGraphQLSchema.ts --require ts-node/registerpnpm exec graphql-inspector introspect https://my-prod-env/graphqlConfirming I think that this is an actual bug in the diff algo and not environmental
I also cannot reproduce if I diff using HTTP for both old and new. In this case I get no changes detected
To Reproduce Steps to reproduce the behavior:
pnpm exec graphql-inspector diff https://my-prod-env/graphql ./scripts/makeGraphQLSchema.ts --require ts-node/registerOutput:
Expected behavior
No difference in schema.
Environment:
@graphql-inspector/cli: 5.0.8graphql: 16.10.0 (and 16.8.1, I tried upgrading)Additional context
Contents of my script:
We use GraphQL codegen to combine a bunch of *.graphql definitions into a single typeDef. We version control the generated typeDef though so I can say with confidence that it does contain the @deprecated field.