-
Notifications
You must be signed in to change notification settings - Fork 177
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 field needs to be nullable, at least on Input #409
Comments
Answered on StackOveflow. Copying here for posterity:
Btw, it's highly advised to upgrade to the latest version of the starter. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(Also posted on StackOverflow: https://stackoverflow.com/questions/68957980/how-to-handle-identity-fields-in-graphql-spqr)
I have a field as follows:
@id @GeneratedValue(strategy=GenerationType.IDENTITY)
@JsonProperty
@column(name="trade_id")
int tradeId;
Somehow, SPQR is concluding that this field should not Not Null, even though I am not explicitly declaring it as such.
input TradeInput {
tradeId: Int!
The trouble is, when I create a Trade object, the tradeID value is going to be generated by the database. So I never want to pass one in. However, I don't want to ignore the field entirely, because when I'm retrieving Trade objects, I want to include the ID.
Is there a way to do this? I'm using graphql-spqr-spring-boot-starter v 0.0.4
The text was updated successfully, but these errors were encountered: