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.

Uknown types and fields - but they work in the app

See original GitHub issue

Version and Environment Details

Operation system:

MacOS 10.14.5

IDE name and version:

Webstorm 2019.1 and the 2019.2 EAP

Plugin version:

2.2.0

Expected Behaviour

Recognize valid GraphQL types and fields.

Actual Behaviour

Highlights MemberInput as Unknown type “MemberInput” and addMember as Unknown field “addMember”. All my queries and mutations on all components have the same issue. If I uncheck the plugin in the IDE then this flagging goes away. The mutations and queries perform as expected either way so this is a plugin, not code, issue.

const addMember = gql `
          mutation addMember($input: MemberInput!) {
              addMember (input: $input) {
                  first_name
                  last_name
                  user_name
              }
          }`;

this.apollo.mutate({
          mutation: addMember,
          variables: {
            input: {
              first_name: first_name,
              last_name: last_name,
              user_name: user_name,
            }
          },
        })
        .subscribe(result => {
          console.log('result.data in subscribe: ', result.data);
          errors = result.errors;
          console.log('errors in mutate', errors)
        });

Steps to Reproduce / Link to Repo with Reproduction and Instructions

Just writing a query or mutation causes this. The schema is compiled by Nestjs on the server as such:

graphql.schema.ts

export class MemberInput {
    first_name: string;
    last_name: string;
    user_name: string;
}

export abstract class IMutation {
    abstract addMember(input: MemberInput): Member | Promise<Member>;

    abstract updateMember(member_id: number, input: MemberInput): Member | Promise<Member>;

    abstract deleteMember(member_id: number): Member | Promise<Member>;
}

This behavior started recently. I didn’t change the IDE version and I also tried 2019.2 EAP.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19

github_iconTop GitHub Comments

12reactions
tintin10qcommented, May 6, 2021

He never came back.

1reaction
jimkyndemeyercommented, Jul 15, 2019

A couple of things to check:

  • In the GraphQL tool panel it should show the default schema. It should list any errors and how many types it has found during discovery. You can double click the type summary tree node to see type names and associated files they’re declared in
  • If no types are found, and you do have a .graphqlfile, then verify that it’s within the Project scope, e.g. not excluded or in an excluded folder
  • As a final step you could do a File menu > “Invalidate caches /Restart”. This can solve issues with index corruption during upgrades
Read more comments on GitHub >

github_iconTop Results From Across the Web

Different field types in Zaps - Zapier
Boolean fields can only have two values: "true" or "false". Depending on the app, these values may be different, such as "0" for...
Read more >
PowerApps Entities: How To Add Different Types of Fields
Learn how to add text fields, calculated fields, and other types of fields when you're working with PowerApps entities.
Read more >
Introduction to data types and field properties - Microsoft Support
Overview of data types and field properties in Access, and detailed data type reference. including Memo, Date/Time, and Text.
Read more >
unknown field in struct literal - Stack Overflow
I 'm trying to create a struct, and it is giving me an error, telling me the field is unknown. ... All The...
Read more >
Error: Unknown or inaccessible field | Looker - Google Cloud
Option 1: The field does not exist​​ If the field user_order_facts. lifetime_orders is referenced in LookML fields but does not exist as a...
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