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

Type.someField should provide "deprecationReason" instead of "isDeprecated" #1313

Closed
eliw00d opened this issue Apr 18, 2018 · 1 comment
Closed

Comments

@eliw00d
Copy link

eliw00d commented Apr 18, 2018

So, I am trying to reuse some fields in other objects by spreading them like so:

fields: {
    ...Type.getFields()
}

Where Type has the fields I want to reuse.

However, I get the following error:

Error: Type.someField should provide "deprecationReason" instead of "isDeprecated".

None of the fields have isDeprecated in my code, but I'm guessing those get added later internally. If I add isDeprecated to one of the fields I get the same error.

Is isDeprecated no longer used or am I not using .getFields correctly?

@leebyron
Copy link
Contributor

The code you're writing is not supported, the result of getFields() is a runtime representation of fields, not original field configuration. If you wish to reuse field definitions across types, you should export the field definition code directly

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