I use ApolloClient 3 and webpack's graphql-tag/loader
. The beginning of my file looks like:
#import '../../hooks/fragments/User/basicUserInfo.gql'
fragment IsLeftSidebarOpen on Query {
isLeftSidebarOpen @client
}
These 3 following snippets are in the same file that IsLeftSidebarOpen
fragment is. Of course I test them one by one by changing file, not all at once.
Could you explain me why
a) this works
query FetchData {
me {
...BasicUserInfo
}
isLeftSidebarOpen @client
}
b) this also works
query FetchData {
...IsLeftSidebarOpen @client
}
c) but this throws the following error Unknown fragment "IsLeftSidebarOpen"
query FetchData {
me {
...BasicUserInfo
}
...IsLeftSidebarOpen @client
}
IsLeftSidebarOpen
is defined and how you are importing it. Also, if you're using the graphql-tag loader, that should be mentioned.