Search code examples
javaintellij-ideagraphql

IntelliJ IDEA does not recognize the format of GraphQL schema in resources directory


I have a Spring Boot project with GraphQL in IntelliJ IDEA.

ItelliJ IDEA does not recognize the .graphqls format of the schema, but displays an error message "Image not loaded" instead.

Here how it looks in IntelliJ:

enter image description here

What am I missing?


Solution

  • According to the weird icon of your graphqls file

    enter image description here

    instead of

    enter image description here

    and the weird error message

    Image not loaded

    enter image description here

    it sounds like IntelliJ Idea considers your file as an image file.

    • Check if you have the GraphQL plugin installed
    • Check if you have the file extension properly registered.
      File | Settings | Editor | FileTypes | GraphQL
      It should look like this:

    enter image description here

    • If you don't have it like above, search for the icon your IntelliJ marks your graphqls file with and find where it is registered wrongly.