Open Mayank1791989 opened 7 years ago
From @kumarharsh on June 5, 2017 12:8
@gaoxiaoliangz thank you for the report. The plugin shouldn't be throwing this error, as the interpolation you're doing is perfectly valid. I'm myself writing components like so:
Please make sure that you're using the latest gql library. If you get this error even after updating, then can you give me a small example project which can reproduce this error?
Actually, the plugin will throw an error as gql parser only support interpolation inside operations and fragments (relay style) not outside as in apollo.
Would this also need an isApollo: true
config similar to isRelay: true
that's in the docs?
@tizmagik Yes you are right. But in v3 I have replaced isRelay with general env option which takes package name. This package comes with few env ('relay', 'apollo' and 'relay-modern') and new env can be added by creating new packages.
Is this supposed to work in the current version or if not any update on when it will land?
@ntziolis I have released a new version v2.6 with document interpolation support.
Confirming this works on my end after the update
From @gaoxiaoliangz on June 2, 2017 11:31
When writing graphql queries, I often have to import external gql files and use them as fragments, like so:
but the plugin give me '[graphql] Syntax Error: Unexpected $' error. I know it seems to be an error for the plugin, but in the real world, it works fine, so how to disable that line of linting so it would not produce errors like that?
Copied from original issue: kumarharsh/graphql-for-vscode#31