Skip to content
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

HandleBars Input Type field default value - not found #2

Open
JohnnyMaxK opened this issue Feb 7, 2019 · 1 comment
Open

HandleBars Input Type field default value - not found #2

JohnnyMaxK opened this issue Feb 7, 2019 · 1 comment

Comments

@JohnnyMaxK
Copy link

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:

  1. 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
            },
  1. 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
@JohnnyMaxK JohnnyMaxK changed the title HandleBars Input Type field default value HandleBars Input Type field default value - not found Feb 7, 2019
@JohnnyMaxK
Copy link
Author

Up ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant