js-graphql-intellij-plugin: [v2] Unknown fragment spread "..."

Hi Jim,

I am getting a warning while try to use fragment in a query (which executes without any error):

image

fragment basicInfo on Bathroom {
  name
  slug
}

query {
  bathrooms (pager: {
    limit: 1,
    type: NUMBER
  }) {
    nodes {
      ...basicInfo
    }
  }
}

But no error return after fetch data:

{
  "data": {
    "bathrooms": {
      "nodes": [
        {
          "name": "1",
          "slug": "1"
        }
      ]
    }
  }
}

Details:

PhpStorm 2019.1 EAP
Build #PS-191.6014.13, built on March 6, 2019
PhpStorm EAP User
Expiration date: April 5, 2019
JRE: 1.8.0_202-release-1483-b31 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 8.1 6.3
---
JS GraphQL: v2.0.0-alpha-8

P.S. Please let me know if you need more details.

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16

Commits related to this issue

Most upvoted comments

@jahudka Have you tried the following:

# operations.graphql
type Query
type Mutation
# other-schema-files.graphql
extend type Query {
 operationName: OperationType
}

extend type Mutation {
 operationName: OperationType
}

This validates according to the GraphQL spec, and should be supported by the plugin.

The same extends approach is used by Apollo to add client fields to the Query type and other types: https://github.com/jimkyndemeyer/graphql-config-examples/blob/master/extend-client-fields-and-directives/client-schema-extensions.js

@dandrei Yeah that’s the valid issue. When you split your schema into multiple files. This error always popup.

@jimkyndemeyer I am facing the same issue. Do you plan to fix this issue?

P.S. I am using the following library to split my schema into chunks (later combined on runtime): https://github.com/prisma/graphql-import

Thank you, Jim, for your great efforts!

Fragment definitions will be picked up in scratch files as well for the upcoming beta-1 release.

Best regards, Jim.