Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ID being stripped from Query #140

Open
zyonnetworks opened this issue Jan 2, 2020 · 1 comment
Open

ID being stripped from Query #140

zyonnetworks opened this issue Jan 2, 2020 · 1 comment

Comments

@zyonnetworks
Copy link

My model has ID, but it's being stripped from the query after being built. How do I force ID to be a part of the query without creating a custom query?

export default class User extends Model {
  static entity = 'users'
  static primaryKey = ['id']

  static fields() {
    return {
      id: this.attr(null),
      firstName: this.string(''),
  }
}

produces this graphQL query...
query Users { query users { firstName } }

I expect it to product this query...
query Users { query users { id firstName } }

When running User.fetch(); it causes ID to be set to _no_key_48466. My schema contains ID. Here is my graphQL schema.

type User {
  id: ID! @id
  firstName: String
}

Thanks in advance.

@phortx
Copy link
Collaborator

phortx commented May 2, 2020

Hi, could you please check if this still is a problem in the latest release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants