question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Unknown field" - does not resolve to a valid schema type (New in plugin version 2.5)

See original GitHub issue

Describe the bug

  • Started to notice after update of the js-graphql plugin to version 2.5 (and Android studio to 4.0)
  • Viewing our file with grapql queries now all requested fields are red and on hovering show error “Unknown field”
  • No auto-suggestion when typing
  • But: Can still run queries against our Graphql endpoint
  • When installing the previous plugin version 2.4: All works fine with auto-suggestion and no red errors

To Reproduce

  • Sorry I’m only having a full production API graqhql, but here is the condensed definition related to the screenshots - maybe something to do with the extra defined 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

  • No errors shown in graphql file
  • When typing after a query: get suggestions for the available fields

Screenshots

Using version 2.5:

Screenshot 2020-06-17 at 15 48 42

Screenshot 2020-06-17 at 15 51 06

Using version 2.4:

Screenshot 2020-06-17 at 15 53 14

Version and Environment Details Operation system: macOS IDE name and version: Android Studio 4.0 Plugin version: 2.5

Additional context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:16

github_iconTop GitHub Comments

9reactions
ContrerasAcommented, Aug 31, 2022

For anyone having trouble with this, I found out what I was doing wrong (This is in Webstorm, but should work the same in Intellij)

Create your .graphql.config file and click the green arrow icon to generate the schema.graphql image

This will create a new schema file in the chosen directory. You should then have auto complete and proper syntax highlighting in your own .graphql files image

3reactions
segfaultDeliriumcommented, Mar 14, 2022

Hello, I am currently having this problem. here is content of scratch.graphql file:

query ScratchQuery {
    allUsers{
      username
    }
}

When I run this query it correctly returns data, but when I hover over allUsers or username I get “Unknown field allUsers The parent selection or operation does not resolve to a valid schema type”.

How do I fix this and get schema autocompletion and validation?

I am using GraphQL 3.1.2 plugin in PycharmProfessional. Here is .graphqlconfig file content:

{
  "name": "Untitled GraphQL Schema",
  "schemaPath": "schema.graphql",
  "includes" : ["./src/**/*.graphql"],
  "extensions": {
    "endpoints": {
      "Default GraphQL Endpoint": {
        "url": "http://localhost:7777/graphql/",
        "headers": {
          "user-agent": "JS GraphQL"
        },
        "introspect": true
      }
    }
  }
}

the scratch.graphql file in in src folder. If you need more info please let me know.

I also get a A schema should have a 'query' operation defined error in my graphql window, but the generated by graphql schema has type Query defined, so I don’t know what the problem is.

Read more comments on GitHub >

github_iconTop Results From Across the Web

does not resolve to a valid schema type (New in plugin ...
Describe the bug. Started to notice after update of the js-graphql plugin to version 2.5 (and Android studio to 4.0); Viewing our file...
Read more >
js-graphql-intellij-plugin - Bountysource
I have added my schema to a .graphql file in my main project directory. I now get this error: image. This is very...
Read more >
@pothos/plugin-errors - npm
A Pothos plugin for adding typed errors into your schema. ... plugin will automatically resolve to the corresponding error object type.
Read more >
Release Notes - Flyway by Redgate • Database Migrations ...
Fix issue where post schema clean didn't include correct schemas. Clean mode now cleans more schemas for SQL Server integrated authentication logins. Issue...
Read more >
Hibernate ORM 5.4.33.Final User Guide - Red Hat on GitHub
Since there was no explicit type mapping, Hibernate looks to the BasicTypeRegistry to find the registered mapping for java.lang.String .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found