Closed angelica-snowit closed 1 year ago
Hi @angelica-snowit! Sorry for the late reply. If it's still an issue for you, please follow the instructions here https://github.com/JetBrains/js-graphql-intellij-plugin/issues/438#issuecomment-1518797152.
It's also worth trying to update your installed GraphQL plugin to the latest version 4.0.0.
Updated this morning. Wonderful: now not only ID and other scalars are not recognized, everything is marked as error. The schema appears to be empty, no matter how many time I clear cache and restart.
@angelica-snowit I'm sorry to hear that 😞. Have you checked the logs? Is there anything related to GraphQL there?
If you're using a schema in JSON format, you may try converting it into GraphQL to see if it helps. The easiest way to do this is by following the instructions in the screenshot below. Don't forget to change the schemaPath
parameter to point to the newly created file.
Yes, I've already tried graphql schema (both generated that the same created by the plugin using the remote url), same result :( Also checked the logs, nothing.
@angelica-snowit Okay, that seems very strange. We have some issues, but in your case, it doesn't work at all despite any efforts to fix it.
We had some weird cases when it could behave that way:
Make sure that neither the directory containing the configuration file nor the directory containing the schema are marked as excluded in the IDE. This may not be applicable to you, but it's still worth mentioning.
Do you use a .graphqlconfig
? We had an old issue related to it when a file association was broken by the IDE, so a plugin couldn't grab a config at all. Probably, the best thing you can do here to ensure that it's not the reason is to create a graphql.config.yml
with
schema: ./src/GraphQL/schema.json
Note, that it will work only in 4.0.0 plugin version.
A similar issue with file associations could happen with GraphQL files. Please, ensure, that when you create a query.graphql
file, it's recognized by the IDE and has a correct icon, it shouldn't be just a plain text file.
Which IDE do you use? For example, in Rider, it's possible that some files are excluded from indexing due to the C# project model.
Regarding an issue with unresolved built-in types. Do you have that file in external libraries?
Than you for the follow-up. I've already tried all this:
Maybe it's related to the schema itself then? Could you share a schema file (probably not, but I couldn't resist asking)? Have you tried providing some simple types as SDL definitions instead of using your current schema? Like:
type User {
id: Int
}
type Query {
user: User
}
I'm having a similar issue, if not the same issue.
I used your simple schema
I found my issue, I had to add my root directory as the project root, so it was an .idea issue in this project. I'm the only one using webstorm so I typically gitignore the idea file....I may change that practice.
I cant't find a way for the plugin recognize standard scalars, like ID or String. I keep getting
Error:(1, 33) Unknown type "ID"
All the custom types works well.I've a basic configuration:
The local schema file is generated by GraphQL Code Generator.