WebStorm で graphql のクエリでエラーが出る場合の対応

● WebStorm で graphql のクエリでエラーが出る場合の対応

webstorm などで 以下のようなエラーが出ることがあります

apollo client the parent selection or operation does not resolve

対策 graphql.config.yml をプロジェクトトップに作成する

graphql.config.yml

{
  "name": "Gatsby Schema",
  "schemaPath": "gatsby.graphql",
  "extensions": {
    "endpoints": {
      "Gatsby GraphQL Endpoint": {
        "url": "http://localhost:4000/graphql/",
        "headers": {
          "user-agent": "JS GraphQL"
        },
        "introspect": false
      }
    }
  }
}

参考: https://bit.ly/45rB2zC

No.2350
05/23 15:07

edit