kamilkisiela / graphql-inspector

🕵️‍♀️ Validate schema, get schema change notifications, validate operations, find breaking changes, look for similar types, schema coverage
https://the-guild.dev/graphql/inspector
MIT License
1.65k stars 185 forks source link

Github Action fails with "Invalid or incomplete introspection result." #2123

Open CelsoSantos opened 2 years ago

CelsoSantos commented 2 years ago

Describe the bug

Whenever trying to use the Github Action, the jobs will fail with the following message, even though the introspection file DOES follow the rule:

Error: Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: { data: { __schema: [Object] } }.

To Reproduce Steps to reproduce the behavior: Run/Apply the configuration demonstrated on the Environment section and the error should be present

Expected behavior

Expected the process to either do nothing but exit in a success state or get a changelog if changes are present.

Environment:

  graphql-changelogs:
    name: Generate GraphQL API Changelogs
    needs: changes
    runs-on: ubuntu-latest
    timeout-minutes: 5
    if: needs.changes.outputs.graphql-api-docs == 'true'

    steps:
      - name: Checkout code
        uses: actions/checkout@v3
        with:
          fetch-depth: 1

      # - uses: kamilkisiela/graphql-inspector@master
      #   with:
      #     name: 'Validate AC API'
      #     schema: 'master:actionable-content/ac-api/src/main/resources/graphql/schema.json'

      - name: 'Validate Notifications API'
        uses: kamilkisiela/graphql-inspector@v3.1.2
        with:
          name: 'Validate Notification API'
          schema: 'master:notification/notification-api/src/main/resources/graphql/schema.json'

EDIT: Adding a screenshot of the schema file (cannot share the file though, sorry) Screen Shot 2022-06-30 at 11 43 41

CelsoSantos commented 2 years ago

no updates or possible solutions to check?

sebj commented 2 years ago

Seeing the same issue with a similar schema file format here, comparing local JSON schema against an endpoint.

CelsoSantos commented 2 years ago

Can we please sort this out? How can I help?

pstarritt-evooq commented 2 years ago

I am also experiencing this issue. Any update would be greatly appreciated

      - uses: kamilkisiela/graphql-inspector@master
        with:
          name: Validate GraphQL API
          schema: 'master:path/schema.json'
{
  "data": {
    "__schema": {
      "queryType": {
        "name": "Query"
      },
      "mutationType": {
        "name": "Mutation"
      },
      "subscriptionType": null,
      "types": [......],
      "directives": [.......]
  }
}

Query master:path/schema.json Query refs/pull/8630/merge:path/schema.json from Got both sources Error: Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: { data: { __schema: [Object] } }.