Skip to content

EnumType not working #60

@tdelabro

Description

@tdelabro

File1:

       import { EnumType } from 'json-to-graphql-query';


        let email = "[email protected]";
        let location = { city: "Paris", country: "France", number: "4", postCode: "75008", street: "avenue des Champs Elysee" };
        let identity = { type: new EnumType("PERSON"), optPerson: { firstname: "Pierre", lastname: "Fabre" } };
        let payout_settings = { type: new EnumType("ETHEREUM_ADDRESS"), optEthAddress: "0x123" };

file2:

       import {  jsonToGraphQLQuery } from 'json-to-graphql-query';

       let mutation = jsonToGraphQLQuery({
        mutation: {
            updateProfileInfo: { __args: { email: email, location: location, identity: identity, paytoutSettings: payoutSettings } }
        }
    });
    
    console.log(mutation)

Output:

mutation { updateProfileInfo (email: "[email protected]", location: {city: "Paris", country: "France", number: "4", postCode: "75008", street: "avenue des Champs Elysee"}, identity: {type: {value: "PERSON"}, optPerson: {firstname: "Pierre", lastname: "Fabre"}}, paytoutSettings: {type: {value: "ETHEREUM_ADDRESS"}, optEthAddress: "0x123"}) }

You see:
type: {value: "PERSON"} and type: {value: "ETHEREUM_ADDRESS"}
what is expected is type: PERSON and type: ETHEREUM_ADDRESS. This is straight up what the feature is supposed to do.

I'm using "json-to-graphql-query": "2.2.4"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions