Open MegaJSDeveloper opened 4 years ago
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":
the same can be achieved in the IDE by adding a special comment:
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
version 2.3.0
but in
.graphql
file works correct