Urigo / graphql-cli

πŸ“Ÿ Command line tool for common GraphQL development workflows

Home Page:https://graphql-cli.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Diff between schemaFile and endpoint can result in false negative

xzyfer opened this issue Β· comments

Describe the bug
Doing a diff between a schemaPath and an endpoint can result in a false negative if the schema doesn't reference all scalar types.

To Reproduce
Steps to reproduce the behavior:

  1. Create a simple schema as test.graphql
schema {
  query: RootQuery
}

type RootQuery {
  foo: Foo
}

type Foo {
  id: String
}
  1. Serve the schema locally
npx -p graphql -p @graphql-inspector/cli -c "graphql-inspector serve test.schema"
  1. Create a .graphqlconfig for the schema
{
  "projects": {
    "test": {
      "schemaPath": "test.graphql",
      "extensions": {
        "endpoints": {
          "local": "http://localhost:4000"
        }
      }
    },
  }
}
  1. Run the diff command
npx graphql-cli diff --project test --endpoint local
  1. See the report differences
--- local (http://localhost:4000)	removed
+++ a.graphql	added
@@ -1,8 +1,4 @@
-schema {
-  query: RootQuery
-}
-
 type Foo {
   id: String
 }


BREAKING CHANGES:
  βœ– Int was removed.
  βœ– Float was removed.
  βœ– ID was removed.

Expected behavior
No changes should be reported.

Versions (please complete the following information):

  • OS: macOS Mojave
  • graphql-cli: 3.0.11

Any thoughts on this?

We've just released new alpha versions channel for GraphQL CLI - 4.0.0-alpha.XXX!

We use GraphQL Inspector as the default package for the diff command to track changes between schemas.

Checkout new instructions and the migration guide and we will be happy to hear your feedback during that alpha period!

Feel free to contact us by opening an issue or using our Discord channel;
https://discord.gg/xud7bH

I've posted the wrong Discord link, this is the correct one: https://discord.gg/xud7bH9