Open
Description
Describe the bug
I'm not sure if graphql-coden-csharp is in cause but I cannot see the default value of input type field when I'm using HandleBars.
When I show the content of the input node from the handle bars point of view I have this:
{ name: 'OrderByInput',
description: '',
fields:
[ { name: 'by',
description: 'The column you want to make the order by',
arguments: [],
type: 'MerchantOrderBy',
raw: 'MerchantOrderBy!',
isNullableArray: false,
isArray: false,
isRequired: true,
hasArguments: false,
isEnum: true,
isScalar: false,
isInterface: false,
isUnion: false,
isInputType: false,
isType: false,
directives: {},
usesDirectives: false },
{ name: 'direction',
description: '',
arguments: [],
type: 'Direction',
raw: 'Direction!',
isNullableArray: false,
isArray: false,
isRequired: true,
hasArguments: false,
isEnum: true,
isScalar: false,
isInterface: false,
isUnion: false,
isInputType: false,
isType: false,
directives: {},
usesDirectives: false } ],
interfaces: [],
isInputType: true,
hasFields: true,
hasInterfaces: false,
directives: {},
usesDirectives: false }
To Reproduce
Steps to reproduce the behavior:
- Use '...' as schema
# The best query of the world
type Query
{
merchants(input:OrderByInput):[Merchant]
}
schema{
query: Query
}
type Merchant
{
code: String!
}
enum Direction{
ASCENDING,
DESCENDING,
}
enum MerchantOrderBy
{
CREATION,
MODIFICATION
}
input OrderByInput
{
# The column you want to make the order by
by: MerchantOrderBy! = CREATION
direction: Direction! = DESCENDING
}
I can transform without any lost into an Introspection schema using the graphql-code-generator:
{
"kind": "INPUT_OBJECT",
"name": "OrderByInput",
"description": "",
"fields": null,
"inputFields": [
{
"name": "by",
"description": "The column you want to make the order by",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "ENUM",
"name": "MerchantOrderBy",
"ofType": null
}
},
"defaultValue": "CREATION"
},
{
"name": "direction",
"description": "",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "ENUM",
"name": "Direction",
"ofType": null
}
},
"defaultValue": "DESCENDING"
}
],
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
- Run the following command:
gql-gen ...
gql-gen --schema "schema.graphql.json" --template graphql-codegen-csharp --out "schema.generated.cs"
Expected behavior
I expect to see the properties in the input field:
- hasDefaultValue
- defaultValue
Environment:
- OS: Windows
- Codegen: gql-gen
- Node: v10.15.0
Metadata
Metadata
Assignees
Labels
No labels