Js-graphql-intellij-plugin: Support for IDEA GraphQL language injections

Created on 6 Jan 2020  路  3Comments  路  Source: jimkyndemeyer/js-graphql-intellij-plugin

image
version 2.3.0

but in .graphql file works correct
image

bug

Most helpful comment

@jimkyndemeyer Language Injection is a JetBrains feature that does not work correctly with your plugin. I just found the bug. language = LANGNAME is the standard feature of JetBrains to activate Language Injection feature, this is not just my comment, this is a utility syntax construction for Idea engine.

I could do the same by pressing alt + enter and selecting "language injection":

image

the same can be achieved in the IDE by adding a special comment:
image

Language Injection is a JetBrains feature that does not work correctly with your plugin. All GraphQL language injections should be parsed by your plugin as separate .graphql files. If the problem is not with your plugin, then report a bug of Language Injection to JetBrains

All 3 comments

Hi,

Thanks for using the plugin.

Schema discovery looks for tagged template literals named gql or graphql. This is done for performance reasons to support very large projects.

If you prefer to declare your schema types in a JS file, and don't use frameworks such as Apollo or Relay, you can define your own simple graphql function, in which types are picked up by the plugin, as follows:

function graphql(strings, ...placeholders) {
    return strings[0];
}

const schema = graphql`
    type User {
        name: String
    }

    type Query {
        user: User
    }
`;

Best regards,
Jim.

@jimkyndemeyer Language Injection is a JetBrains feature that does not work correctly with your plugin. I just found the bug. language = LANGNAME is the standard feature of JetBrains to activate Language Injection feature, this is not just my comment, this is a utility syntax construction for Idea engine.

I could do the same by pressing alt + enter and selecting "language injection":

image

the same can be achieved in the IDE by adding a special comment:
image

Language Injection is a JetBrains feature that does not work correctly with your plugin. All GraphQL language injections should be parsed by your plugin as separate .graphql files. If the problem is not with your plugin, then report a bug of Language Injection to JetBrains

Related #308

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tkvlnk picture tkvlnk  路  3Comments

oknesar picture oknesar  路  5Comments

dhay picture dhay  路  5Comments

MichaelDeBoey picture MichaelDeBoey  路  4Comments

MaxmaxmaximusAWS picture MaxmaxmaximusAWS  路  4Comments