major icon indicating copy to clipboard operation
major copied to clipboard

Undocumented GraphQL specification limitations and unsupported GraphQL types

Open ryankauk opened this issue 5 years ago • 0 comments

Issues

  • abstract class of interface type has no method build() but the implementations of them do
abstract class MyInterfaceBuilder {
  void replace(MyInterface other);
  void update(void Function(MyInterfaceBuilder) updates);
  MyInterfaceType get type;
  set type(MyInterfaceType type);
}
  • Inline fragment Interface is building extension with static type "Character" referenced in example https://github.com/micimize/major/blob/7b4eb637ff67b2ea3e9d4031970603dae4121983/major_graphql_generator/lib/src/builders/executable/print_inline_fragments.dart#L163
  • This ends up getting generated for my interface type
@BuiltValue(instantiable: false)
abstract class MyInterfaceType  {
    if (selectionSet is Closure: (String) => String from Function 'selectionSetOf': static.(MyInterfaceTypeExtension)){
        return MyInterfaceTypeExtensionBuilder();
    }
}

when it should be:

@BuiltValue(instantiable: false)
abstract class MyInterfaceType  {
    if (selectionSet is MyInterfaceTypeExtension){
        return MyInterfaceTypeExtensionBuilder();
    }
}

Unsupported GraphQL Types

  • Unions: Errors show up because the types don't implement the union name

Are unions able to be supported? I couldn't find an example or test case with it and have and issue with the property

Limitations on GraphQL Definitions

  • No capitals are allowed on field

  • Field name cannot be named the same thing as a root type

  • filenames must be .graphql

  • No documentation for options

    Overall I don't see these things as a big deal but I think they should be stated somewhere.

ryankauk avatar Jul 26 '20 05:07 ryankauk