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)
- Java class generation fails on default value objects HOT 2
- Consider allowing to configure class name prefixes for better usage alongside mapping frameworks HOT 2
- Allow user to add custom directive to generated types HOT 23
- Generation failed with ClassNotFound com/squareup/kotlinpoet/TypeNames HOT 10
- The Parameter "generateInterfaceSetters" does not seem to work HOT 3
- Read typeMapping from a properties file available in compile-classpath
- Option `schemaJarFilesFromDependencies` don't work HOT 4
- Missing option to specify custom scalars in generated kotlin2 clients HOT 2
- `addGeneratedAnnotation` should not be configured in usage section of README HOT 8
- 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
- Reported maven plugin issues HOT 3
- Wildcard for specifying schema files HOT 1
- Duplicate entries in schemaPaths HOT 1
- Generating of graphql client in Kotlin is generating classes with unresolved references HOT 6
- Do not generate sources if schema was not changed HOT 4
- upgrade setup-java to v3
- The plugin conflicts with openapi-generator-maven-plugin HOT 5
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.