-
-
Notifications
You must be signed in to change notification settings - Fork 206
Description
Issue workflow progress
Progress of the issue based on the
Contributor Workflow
- 1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox
Make sure to fork this template and run
pnpm generatein the terminal.Please make sure the Codegen and plugins version under
package.jsonmatches yours. - 2. A failing test has been provided
- 3. A local solution has been provided
- 4. A pull request is pending review
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.8graphql: 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.