You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{gql}from'apollo-server';import{createTestClient}from'apollo-server-testing';import{apolloServer}from'./apolloServer';it('test 1',async()=>{constQUERY=gql` { example { ...MyFragment } } fragment MyFragment on Character { name age } `;const{ query }=createTestClient(apolloServer);constresult=awaitquery({query: QUERY,});expect(result).toMatchSnapshot();});it('test 2',async()=>{constQUERY=gql` { example2 { ...MyFragment } } fragment MyFragment on Character { name age } `;const{ query }=createTestClient(apolloServer);constresult=awaitquery({query: QUERY,});expect(result).toMatchSnapshot();});
Both run fine at runtime but at development time (in VSCode via Kumar's extension), I get this error:
There can be only one fragment named "MyFragment". (UniqueFragmentNames)
It looks like the validation isn't scoped to a single gql` ` string or something.
@borekb Currently scope is file. In V3 branch I have made scope configurable. For now you can suppress errors in your test files by disabling the validation rule.
I have two tests like this:
Both run fine at runtime but at development time (in VSCode via Kumar's extension), I get this error:
It looks like the validation isn't scoped to a single
gql` `
string or something.This is my config:
The text was updated successfully, but these errors were encountered: