Describe the bug
grapql queries now all requested fields are red and on hovering show error "Unknown field"To Reproduce
type?allStudios(
first: Int
): StudioConnection!
type StudioConnection {
edges: [StudioEdge!]
pageInfo: PageInfo!
totalCount: Int!
}
I really hope this helps. If not I can try to workout a simple demo project, but will take me longer
Expected behavior
Screenshots
Using version 2.5:


Using version 2.4:

Version and Environment Details
Operation system: macOS
IDE name and version: Android Studio 4.0
Plugin version: 2.5
Additional context
Hi Frederike,
Thanks for using the plugin.
Could you please attach a 2.5.0 screenshot of the GraphQL tool panel which shows the result of schema discovery and any errors that may prevent the schema from being built.

is that what you are looking for? I'm having the same issue. This is using the github schema (https://github.com/octokit/graphql-schema/blob/master/schema.json)
@AllanWang Thanks, yes it was. I see that the schema has been discovered, at least in your case.
On that basis I'm thinking that this may be related to indexing/caching used by the editor. Can you try the "File" > "Invalidate Caches / Restart" menu action and then click the "Invalidate and Restart" button?
I am also having this issue. For me, the schema discovery looks OK (there are types, inputs and scalars).
Interesting remark is that it does find the types, and if I hover my mouse over the base query I get references to the schema.graphql file, but the fields are not recognized.
Even more funny thing is; it works fine in one project, but not in another project..... Both versions use the same version of graphql-tag. I tried the "Invalidate Caches" solution, but it didn't work.
Just comparing both projects again. I work with python/graphene to build the server-side schema.
Initially, I named by query class "Query" and the mutation class "Mutation". In the old project where GraphQL JS worked well, I named them "ReadingQuery" and "MutationQuery".
class Query(graphene.ObjectType):
...
class Mutation(graphene.ObjectType):
....
schema = graphene.Schema(query=Query, mutation=Mutation)
So I renamed them in my current project as well, and now discovery works again!
class ReadingQuery(graphene.ObjectType):
...
class MutationQuery(graphene.ObjectType):
....
schema = graphene.Schema(query=ReadingQuery, mutation=MutationQuery)
Bit more testing shows that the root query in "schema.graphql" should not be named "Query". I named it "ReadingQuery" and all works fine. The name of the Mutation root type does not affect field discovery.

Same issue here.
PhpStorm 2020.2 EAP
Build #PS-202.6109.32, built on July 3, 2020
PhpStorm EAP User
Expiration date: August 2, 2020
Runtime version: 11.0.7+10-b944.16 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 8.1 6.3
---
JS GraphQL: v2.5.0
Using the plugin with 2.4.0 version works fine, 2.5.0 cannot resolve the fields. I tried to invalidate cache but it does not help in this case, the same goes with using earlier versions of WebStorm.
WebStorm 2020.2 Beta
Build #WS-202.6250.10, built on July 8, 2020
WebStorm EAP User
Expiration date: August 7, 2020
Runtime version: 11.0.7+10-b944.18 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 4.19.0-9-amd64
GC: ParNew, ConcurrentMarkSweep
Memory: 725M
Cores: 8
Registry: ide.settings.move.mouse.on.default.button=true
Non-Bundled Plugins: com.intellij.lang.jsgraphql
Current Desktop: KDE
I'm still unable to reproduce this locally. It would be really helpful with specific steps to reproduce, or an example project that demonstrates the issue so that a fix is made possible.
@jimkyndemeyer Sorry for not getting back earlier. Missed the notifications.
I just had a look at our production API schema.json and following the comment from @ErikRtvl I think these first few lines might be the issue when using the latest plugin version? I have no way of changing these & only have one big production project, but hope this might help:
{
"__schema": {
"queryType": {
"name": "Query"
},
"mutationType": {
"name": "Mutation"
},
"subscriptionType": {
"name": "Subscription"
},
"types": [
{
"kind": "OBJECT",
"name": "Query",
"description": "",
"fields": [
{
I'm trying to reproduce this and I have a few guesses, but I'm not sure exactly what the reason is in each case. It would be ideal to get a complete schema, or at least a minimal set of types from it, for which it is possible to reproduce this bug + .graphqlconfig files.
This may occur when something like graphql-modules lib is used, where repeated type declarations with the same name occur in the schema of various modules, which is valid from the library point of view (because these declarations are merged in runtime later), but is not supported in the plugin at the moment.
Another possible reason is this pr in graphql-java 15. Now the schema will be broken if any type extensions with the same fields are found. Like
interface Human {
id: ID!
name: String!
}
extend interface Human {
name: String! # the same field re-declared
friends: [String]
}
Most of all, I want to understand at this point what the structure of your projects is. Specifically, are there places other than the schema specified in .graphqlconfig where types are defined?
Please, especially check if there are any Query type re-declarations type Query { or type extensions with extends keyword.
@friederikewild also errors from the schema file can also be very useful. I can see that you're using schema.json file, but you can try using introspection to generate a file with a .graphql extension. It is quite possible that some errors will be visible in it.
@friederikewild @simon2k @blacksmoke26 @ErikRtvl any info from you is very appreciated 馃檹! It looks like this issue is critical and common, but there are plenty of possible reasons for this behavior.
Closing due to lack of response. If the issue still exists in a new 2.6.0 version, please, feel free to comment here.