robrichard / graphql-fields

Turns GraphQLResolveInfo into a map of the requested fields
MIT License
350 stars 30 forks source link

allow for more succinct argument parsing #50

Closed kyle-villeneuve closed 2 years ago

kyle-villeneuve commented 2 years ago

When the option processArguments: "compact" is specified, the __arguments list will be assembled as an object instead of an array. e.g.

__arguments: { 
  argumentName: { kind: 'Variable', value: false },
  weight: {
      kind: 'FloatValue',
      value: 123.4
    },
}

vs

__arguments: [
    {
        "argumentName": {
            "kind": "Variable",
            "value": false
        }
    },
    {
        "weight": {
            "kind": "FloatValue",
            "value": 123.4
        }
    }
]

this will also require an update to the type definitions located at: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/graphql-fields/index.d.ts

robrichard commented 2 years ago

@kyle-villeneuve this library is deprecated and no longer accepting new features. I recommend migrating to graphql-parse-resolve-info.