...

Text file src/github.com/99designs/gqlgen/codegen/testserver/followschema/interfaces.graphql

Documentation: github.com/99designs/gqlgen/codegen/testserver/followschema

     1extend type Query {
     2    shapes: [Shape]
     3    noShape: Shape @makeNil
     4    node: Node!
     5    noShapeTypedNil: Shape @makeTypedNil
     6    animal: Animal @makeTypedNil
     7    notAnInterface: BackedByInterface
     8    dog: Dog
     9}
    10
    11interface Animal {
    12    species: String!
    13    size: Size!
    14}
    15
    16type Size {
    17    height: Int!
    18    weight: Int!
    19}
    20
    21type BackedByInterface {
    22    id: String!
    23    thisShouldBind: String!
    24    thisShouldBindWithError: String!
    25}
    26
    27type Dog implements Animal {
    28    species: String!
    29    size: Size!
    30    dogBreed: String!
    31}
    32
    33type Cat implements Animal {
    34    species: String!
    35    size: Size!
    36    catBreed: String!
    37}
    38
    39type Coordinates {
    40    x: Float!
    41    y: Float!
    42}
    43interface Shape {
    44    area: Float
    45    coordinates: Coordinates
    46}
    47
    48type Circle implements Shape {
    49    radius: Float
    50    area: Float
    51    coordinates: Coordinates
    52}
    53type Rectangle implements Shape {
    54    length: Float
    55    width: Float
    56    area: Float
    57    coordinates: Coordinates
    58}
    59union ShapeUnion @goModel(model: "followschema.ShapeUnion") = Circle | Rectangle
    60
    61directive @makeNil on FIELD_DEFINITION
    62directive @makeTypedNil on FIELD_DEFINITION
    63
    64interface Node {
    65    id: ID!
    66    child: Node!
    67}
    68
    69type ConcreteNodeA implements Node {
    70    id: ID!
    71    child: Node!
    72    name: String!
    73}
    74
    75" Implements the Node interface with another interface "
    76type ConcreteNodeInterface implements Node {
    77    id: ID!
    78    child: Node!
    79}
    80
    81interface Mammalian implements Animal {
    82    species: String!
    83    size: Size!
    84}
    85
    86# Types with multiple interfaces are evaluated first in the case statement
    87type Horse implements Mammalian & Animal {
    88    species: String!
    89    size: Size!
    90    horseBreed: String!
    91}

View as plain text