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

Surface deprecation fields in Error Objects for Validate #2159

Open
Tracked by #2651 ...
samchungy opened this issue Aug 23, 2022 · 0 comments
Open
Tracked by #2651 ...

Surface deprecation fields in Error Objects for Validate #2159

samchungy opened this issue Aug 23, 2022 · 0 comments

Comments

@samchungy
Copy link

samchungy commented Aug 23, 2022

Is your feature request related to a problem? Please describe.

Firstly big thanks for your repo :)

Secondly,

I would like to populate ${parentType.name}.${fieldDef.name} into the GraphQLError Extensions so I can retrieve it via error.extensions without needing to regex on the string.

`The field '${parentType.name}.${fieldDef.name}' is deprecated.${reason ? ' ' + reason : ''}`,

Describe the solution you'd like

I would like to be able to access deprecations via the error object's extensions.

eg. to access the field via error.extensions.field

Describe alternatives you've considered

Running Regex on the string to pull the path. Seems a bit hacky when the info is right there.

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

Successfully merging a pull request may close this issue.

1 participant