Comments (2)
To the best of my knowledge there isn't a way.
Also - you need to create an input type for your mutation. You can't pass a non input type to a mutation.
I would think about making the input type require a releaseYear in this case.
How would your resolver handle the two scenarios: 1. "not present" null vs 2. "explicit" null, differently?
I've added a mutation to the example repo.
type Query {
shows(titleFilter: String): [Show]
}
type Mutation {
createShow(showInput: ShowInput!): Show
}
type Show {
id: Int
title: String
releaseYear: Int
}
input ShowInput {
title: String!
releaseYear: Int!
}
from graphqlcodegen.
Thank you @deweyjose for your reply. I'm creating a mutation used for updating rows in the database. I'm trying to make the mutation have the ability to "partially update" and "nullify objects", so here's the question.
My design was: If the field is set to null explicitly, it means the request wants to nullify the field in the database. If the field is not presented, the field is ignored. If the field is set to a non-null value, we replace the old value with the new value passed in.
Since we cannot tell the difference between the first 2 scenarios after Inputs are mapped to Java classes, I guess I need to find another way around.
Thanks for your reply.
from graphqlcodegen.
Related Issues (20)
- schemaPaths multiple files HOT 1
- Projection classes generate invalid constructors HOT 4
- generateJava code for client when generateClient is true HOT 1
- Maintainer HOT 7
- generateClient Fails when Query isn't named Query HOT 7
- Add option to skip generation HOT 5
- Plugin delete existing files in <outputDir> HOT 1
- Exclude generated files from code coverage report HOT 6
- Add `maven-release-plugin` HOT 1
- Not able to generate builder classes in Kotlin HOT 2
- Please add a LICENSE file HOT 1
- Fix documentation
- Plugin not generating query client classes
- Include Class Imports and custom annoations HOT 1
- Support for 6.0.1 HOT 1
- Provide a way to pass Java Generic Class as an argument to <typeMapping> HOT 2
- Multiple issues when trying to get a schema from a dependency HOT 2
- integration with codegen and relay pagination HOT 1
- What is the difference between graphql-dgs-codegen-core and graphql-dgs-codegen-client-core? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphqlcodegen.