GraphQLBundle icon indicating copy to clipboard operation
GraphQLBundle copied to clipboard

Sort fields and arguments

Open ooflorent opened this issue 6 years ago • 3 comments

Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? no
Version/Branch n/a

Fields and arguments could be sorted to improve the type readability.

ooflorent avatar Sep 26 '19 08:09 ooflorent

@ooflorent You mean yaml files?

murtukov avatar Sep 26 '19 09:09 murtukov

@ooflorent is think rather introspection and dump-output (.graphql) ?

akomm avatar Sep 27 '19 09:09 akomm

Okay, the idea is this:

MyType:
  type: object
  config:
    fields:
      b:
        type: String
      a:
        type: String

Should produce this:

new ObjectType([
  'fields' => [
    'a' => …
    'b' => …
  ]
])

Instead of this:

new ObjectType([
  'fields' => [
    'b' => …
    'a' => …
  ]
])

By having the fields (and arguments) sorted in the type definition, they will be sorted everywhere.

ooflorent avatar Sep 27 '19 09:09 ooflorent