-
Notifications
You must be signed in to change notification settings - Fork 434
Add skip attribute to input objects #463
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
Comments
Sure, this seems like something we should do for consistency. |
Ok. I’ll see if I can open a PR for it. |
Sounds good! You should probably hold off until we merge the async branch onto master (extremely soon) |
@mwilliammyers I am looking for add #[graphql(skip)] on GraphQLInputObject too. |
@tyranron should we add this feature as a part of |
@ilslv I don't really like the idea of pushing users to something. We have already possibility to provide Of course, we should require the |
What do you think about adding a
#[graphql(skip)]
attribute for derivingGraphQLInputObject
likeGraphQLObject
?I often find myself wanting to skip fields for input objects (e.g. a database
id
that should be auto generated and not set by users).Describe the solution you'd like
It would be awesome to be able to do something like:
Describe alternatives you've considered
From
impls because that seems overkill and my project already takes way too long to compile on very fast hardware.id
field. I would love to do this but Elasticsearch doesn't support this (see [this] issue (Ingest processor cannot access _id on autogenerated id elastic/elasticsearch#41163) and this issue).Additional context
In reality I would use it more like this with the elastic crate:
This would tell elastic to use the
id
field as the document ID and would create a document that looks like:The text was updated successfully, but these errors were encountered: