graphql-go / graphql

An implementation of GraphQL for Go / Golang
MIT License
9.89k stars 840 forks source link

Aliases are not supported in map keys #645

Open astudnev opened 2 years ago

astudnev commented 2 years ago

when i query

{
    hello{
        alias1: id
        alias2: id
    }
}

and submit the map

{
    hello{
        alias1: "1"
        alias2: "2"
    }
}

it returns nil for both aliases

Expected result is alias1 :"1" and "alias2": "2"

There is another case... when i query

{
    hello{
        id
        alias2: id
    }
}

and submit the map

{
    hello{
        id: "1"
       alias2: "2"
    }
}

it returns alias2: "1" and id: "1"

Expected result is id :"1" and "alias2": "2"

both results are wrong!

It may be covered in PR https://github.com/graphql-go/graphql/pull/630 but i have not tested all possible cases