github.com/99designs/gqlgen@v0.17.45/codegen/testserver/singlefile/interfaces.graphql (about)

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