-
Notifications
You must be signed in to change notification settings - Fork 95
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
Plugin recently stopped working, all types erroring #438
Comments
@jmd01 hi! Could you please try invalidating caches? |
I recently encountered this same issue and invalidating the caches (and restarting) corrected the problem for me. |
Unfortunately this didn't work for me. It's a large project though, perhaps it's hitting some sort of limit? |
I managed to solve this via Help > Edit Custom Properties... I inserted the following lines:
Default ist 2500, as soon as my schema file went above this I saw the described problems. Would be better though if the plugin could solve this somehow in another way, at least warn about this explicitely. |
Yes this really needs to be addressed ,idea.max.intellisense.filesize=10240, fixed it for me |
Should be fixed in the recent 3.1.0 release. |
Same problem here, suddenly code objects linking stopped working, together with queries highlighting. Event basic types are showing error Unknown type "Int". I tried invalidate cache, restart, reinstall plugin. Also set idea.max.intellisense.filesize as desscribed above but with no success. IntelliJ IDEA 2021.3.2 (Ultimate Edition) Non-Bundled Plugins: Kotlin: 213-1.6.10-release-961-IJ6777.52 |
I have the same Problem as @TomasMatusek Basic scalars are not recognized If I define the scalars explicitly, it works. IntelliJ IDEA 2021.3.3 (Ultimate Edition) |
I have the same Problem as @TomasMatusek All basic types like Int, String, etc. are marked as errors (with red text color). |
@mattes3 hi, could you please enable one of these checkboxes and then apply settings? It can be related to some changes in that area. |
Sorry, the checkboxes made no difference. |
@mattes3 restarting the IDE doesn't help either? |
Having the same issue same issue. Have tried restart, invalidating cache, uninstall-reinstall, all to no avail. I did notice the following warning in the
|
In my case the basic types still work, but scalars, etc. do not: What I have tried, and did not work:
Found the issue:
|
I have the same problem: "Error:(1, 21) Unknown type "ID"" |
The same problem, all types started error as unknown. |
Also having the this same issue since the last version. |
Having the same issue unfortunately with version 4.0 of the plugin. Tried downgrading to version 3.4 but I'm still getting the error. |
There are many possible reasons why such errors could occur 😞. If you encounter issues after updating to version 4.0.0, please refer to the new docs on plugin configuration. If it didn't help, the first thing to do is to run "invalidate caches and restart" (how to). Then, if you have any unresolved built-in types, please check that you can see a Next, open the logs and search for anything containing "GraphQL". If you find something suspicious, it might be a clue. You can open the location of the logs directory using the corresponding Help menu action: Show Log in Explorer on Windows or Show Log in Finder on macOS. Regarding your case, @ItaiYosephi, the plugin will fall back to the global scope if you don't have any configurations. However, when you have at least one GraphQL configuration file in the project, as you do, it is necessary to configure all scopes correctly. A GraphQL configuration file defines a "module root", and all files under it will be matched against it. Files without such configuration will use a local scope, not a global one. This is done to prevent weird issues like "duplicate type" errors and make scope handling strict and explicit. For example, both a GraphQL Language Service and a VSCode extension based on it requires you to have a configuration file. The simplest fix you can apply is to create an empty GraphQL config in the root of the monorepo. This way, all files under this directory will use it as a scope, except the nested projects that have their specific configs. I understand that it could be inconvenient, but we also have a long history of issues caused by implicitly included files in the scope, which have led to very confusing errors. If anyone has problems with a new configuration file format or with the migration of |
Same problem here since upgrading to V4. If you are wondering how to downgrade the plugin, here's the simple steps:
|
I was expericing a problem with scalars like ID and String. I followed the suggestion to update the plugin, now everything is marked as error, the schema always says is empty, even the one generated by the introspection of the plugin itself. |
My old config had: "includes": ["*.graphql"], This got migrated to: include: '*.graphql' This didn't work. What worked was: include: './**/*.graphql' |
@jorrit Please, note that in the v3 config, you can use a
ATTENTION: All SDLs must now be explicitly configured in the configuration file. The plugin will no longer implicitly grab them. Therefore, files containing SDLs must explicitly match either |
For me it worked like this: I opened the old file {
"name": "My project GraphQL Schema",
"schemaPath": "schema.graphql",
"extensions": {
"endpoints": {
"Default GraphQL Endpoint": {
"url": "http://localhost:3333/graphql",
"headers": {
"user-agent": "JS GraphQL"
},
"introspect": false
}
}
}
} Then a Jetbrains bar at the top was offering to migrate the file which changed the filename to schema: schema.graphql
extensions:
endpoints:
Default GraphQL Endpoint:
url: http://localhost:3333/graphql
headers:
user-agent: JS GraphQL
introspect: false Finally, I simply had to change the first line from |
Same, I have to downgrade to version 3.4.0 to get it back working. That's a bummer :(
Is it possible bring back the old behavior of implicitly grabbing the SDLs? |
@energyd what's the point of configuring a plugin if it ignores a configuration 🤔? Look at the case above, it worked with an obviously incorrect configuration with a path to a missing schema file. And we had a lot of issues when people tried to configure a slightly more complex project, but instead, got a lot of errors with "duplicated types" because of the implicit inclusion of parts that shouldn't be included. I really don't get the point here. This simple
will build a schema from all GraphQL files you have. It's predictable and gives full control over what's going on with schema discovery. The same approach applies to graphql-config and the GraphQL language server, you must specify paths to all schema parts. This plugin should also conform to that behavior to be interoperable with other editors and IDEs. Additionally, the legacy .graphqlconfig has been deprecated for a long time, so we need to do this now or later. I spent a tremendous amount of time trying to support the modern config, and all its features and make it backward-compatible to at least some extent, it was a complete rewrite. Of course, I could break something or miss some use cases, there could be bugs and I've already fixed some of them. So, it would be great if we could find a solution together. I'm ready to fix any issues, help with configuration, and investigate what goes wrong, but I can't just "revert" something. |
@vepanimas thanks for the reply. I just want to say that the previous version actually perform above and beyond my expectation. I didn't have to "configure" anything and it just worked(this is amazing because we have hundreds of graphQL schema/fragments scattered all over the place). I really didn't know anything about what happened behind the scenes (I don't even know that there is a configuration file). The new update that broke what was working before led me here to this thread. I'm really new to GraphQL and I don't understand a lot of the context you've given here. But as a programmer myself I know how hard it is to make a product that satisfy everyone. There is no silver bullet that solves all problem. I think I am really not in a good position to make any suggestion to this project. My apologies. I'm happy to learn how to configure the plugin if that's the only path going forward. |
That's weird, if you don't have any configuration settings and it stopped working, it could be a bug. Without any GraphQL configuration, it should work in the global scope, which includes every GraphQL file in your project. Also, if you have a configuration, but it's empty or contains only the extensions:
endpoints:
dev: https://example.com/graphql You may still have some
The point of the latest update is quite straightforward: configurations should be explicit, correct, and function consistently across different editors. However, if you don't have any configuration and your project is simple, it should work out of the box without any additional steps. |
I've got a set-up where all types are in separate files, and @vepanimas's suggestion in the previous comment solved the problem for me ( Old: schema: schemas/schema.graphqls New: schema: schemas/schema.graphqls
include: ["schemas/**"] Hope this helps others! |
Sharing to help debug for others. I upgraded to Webstorm 2023.1.4 and Graphql plugin 4.0.1. This resulted in my schema.graphql.ts file, giving warnings on all types like below: Looking at @roelofjan-elsinga comment I changed my
to
This solved the issue for me. |
Hi Guys, In my case all the basic types (ID, String, Boolean....) are showing as errors. I tried invalidating the cache, reinstalling the plugin, restarting, and upgrading to the latest IntelliJ as well. For some of my teammates, it works, and not sure what is different in my case. Any help on how to resolve this will be greatly appreciated. IntelliJ IDEA 2023.2 (Ultimate Edition) |
After trying all of the above I think I fixed it for good. I have autocomplete, String and all types in between working. The steps I have identified for fixing it are:
Here is the config
hope this helps you fixing it and to reproduce the scenario 👋 |
nothing helps, the autocomplete just not working, interesting that config is working and I am receiving schema.graphql file from end point.
and my gql file looks like so with all fields => unknown maybe someone can see where I am wrong, cause I am going crazy with this .... UPDATE: Ok, I finally managed to make it work, thanks to the @SergioFaya , I read his comment once more, the one and only important thing is the 2nd one. What I did:
|
Hi guys! I was also struggling with the same problem as @TomasMatusek and basic GraphQL types such as The problem in my case was that for some reason IDE was not recognizing some files with The solution for me was to manually override file type for the Also as suggested by @onyshchuk check your Hope this helps! |
Describe the bug
Recently all types started error as unknown, however the schema discovery works fine and reports no errors, and the suggested fix pop-up is able to find the types.
Eg
"Unknown field "fieldId" on object type "TriggerCriteriaCheckCustomFieldToggle". Did you mean "fieldId"?
Expected behavior
Clearly it can still see the types as it is suggesting the same type as the fix, so it should not report types as unknown.
Screenshots
This is just one file but it is happening in all graphql files:
Version and Environment Details
Operation system: macOS Version 10.15.7
IDE name and version: PHPStorm 2020.3.3
Plugin version: 2.9.1
Additional context
It worked fine until recently
The text was updated successfully, but these errors were encountered: