-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getting unknown fragment lint error #2071
Comments
Huh ok! Can you show me a sample graphql-config? Are you using a compatibility layer for relay + graphql config? What version of relay? We upgraded graphql-config to v4 which may impact compatibility with relay. |
does this error show all the time or only some of the time? |
Hey, thanks for responding. Our graphql.config.js has very minimum settings but it worked with previous versions
relay version: 11.0.3. |
getting this error all the time |
Encountering the exact same issue. Suddenly fragments are flagged as I think a regression was introduced with the latest release. Sadly I'm not able to roll back to a former version as the |
Are either of you including files with fragments in |
My
There are no fragments defined in this file. |
I will look into this one after work tonight, sorry y’all! I’m surprised it worked without documents configured! |
this we moved over a year or two ago for legacy relay support: https://github.com/relay-tools/relay-graphql-js/tree/main/packages/graphql-config but if it worked before and then didn’t, there are a number of factors. What was the previous version? We made many changes in the language server last year that were published to marketplace and not published to openvsx for a while because of a license agreement bug our readme instructs you to use |
I think I have a fix, I will need to do more extensive testing, but #2072 I think will address this and many things. |
Nope. No luck on this one tonight. I have some leads though. Needs way more unit tests |
Thank for your efforts anyway =) |
@esquevin exciting to hear! I think I might just document this as a breaking change then. I think this will be the more |
@esquevin Do you have an example of what you set your |
I'm using this
|
go the same issue here... if i define no dcoument , the output of the graphql-language-service-usage-logs is 👌 but then i get a lot of unknown fragment
but my editor does not show any error (while showing doc, ... as it should) |
sorry for double notif, If i could silence them maybe it can "solve" both problems |
The fragments should be picked up if they are specified in files listed in |
I'm running into this issue myself right now. Figured I'd throw in my $0.02. When I first open a document (e.g. simple query with fragment spread field selection), it shows the ol' "Unknown fragment ..." error. Then I found that if I open the file where I have my fragments defined and immediately save it, then go back go the query document and save that one, it seems to pick up the fragment definitions and the errors disappear. Just to check I tried auto-completions/suggestions and it worked fine and showed fragments in the list. I'm on FreeBSD 13.0/amd64 and NeoVim 0.6.0 with the latest graphql-lsp. My graphql config is as follows... {
"schema": "./src/graphql/generated/schema.json",
"documents": [
"./src/graphql/documents/*.graphql",
"./src/graphql/documents/**/*.graphql"
]
} |
Just tested it out again a few more times since I wasn't 100% sure it wasn't some weird anomaly. I can confirm that the following happens (in my case at least):
|
just wondering if it was related to relay (i use relay) and if it requires some special config in the graphql-config file |
I got this error just because of some VS code plugin. Possibly you can try removing unofficial GraphQL plugins and check if you still see errors or not. |
we fixed the issue with loading from |
For anyone stumbling on this issue, removing |
thanks @lewebsimple , we may be able to set this on |
Hmmm … turns out the problem came back after a little while so it’s probably something else. Sorry about the confusion… |
Hello @acao I'm having the same issue as well. I only have the graphql schema on my graphql config. If i point the documents to my fragment.ts file then it breaks the auto completion and references. I also have this codegen dir but don't know how to incorporate this or why i need to in the graphql config I'm coming from intellij idea and using js-graphql everything is working. I just recently migrated to vs code and would like to make this work. Thank you |
Was getting the same error, found out it's because the extension can't handle loading fragments at symlinks. Example graphql.config.yml: # $schema: https://raw.githubusercontent.com/kamilkisiela/graphql-config/master/config-schema.json
projects:
myproject:
schema: ./projects/myproject/schema.graphqls
documents:
# This directory contains symlinks to all the graphql files for myproject (operations and fragments)
- ./projects/myproject/**/*.graphql
# The VSCode extension doesn't follow symlinks for fragment inclusion, so need to explicitly include them
- ../some/other/explicit/location/of/myproject-fragments.graphql |
Maybe it's not the VSCode extension, but the language server 🤷 |
Actual Behavior
we are using Relay and after the recent updates(starting from version 0.3.23), all the fragments are getting flagged as
unknown fragment
.Expected Behavior
Steps to Reproduce the Problem Or Description
Specifications
Logs Of TS Server || GraphQL Language Service
The text was updated successfully, but these errors were encountered: