graphql-for-vscode icon indicating copy to clipboard operation
graphql-for-vscode copied to clipboard

Types are not merged when extended

Open ganeshpms opened this issue 5 years ago • 3 comments

My .gqlconfig has schema files as following

schema: {
    files: {include: ['libs/schema/src/**/*.gql', 'app/src/client-schema.gql']}
 }

and I have the Query defined inside ../schema folder

type Query {
   item: Item!
   items: [Items!]!
}

and I have the Query defined inside ../app/src/clientschema.gql

extend type Query {
   selectedItems : [Items!]
}

Now, I am writing a query which look like

query Cart {
  items{
     ...
  }
  selectedItems @client{
    ...
  }
}

The above scenario is working fine with gql-gen tool and the app which is wriiten in angular app. The issue is that the VSCode GraphQL is not recognizing the sectedItems and giving linting error.

Expected, merge the types when it is extended using extend, I hope which is not hapening now.

ganeshpms avatar Jan 31 '19 18:01 ganeshpms

Good issue. I think the correct place for this would be the @playlyfe/gql language server repo. @Mayank1791989 is that correct?

kumarharsh avatar Jan 31 '19 20:01 kumarharsh

https://github.com/Mayank1791989/gql/issues/45

lucasconstantino avatar May 28 '19 00:05 lucasconstantino

For those winding up here, it looks like this project is largely abandoned, with a more current VS Code plugin here:

https://marketplace.visualstudio.com/items?itemName=GraphQL.vscode-graphql

arackaf avatar Jun 29 '21 03:06 arackaf