summaryrefslogtreecommitdiff
path: root/examples/Sophisticated/api.gql
blob: c4dee5c540752628c4647d3da86f39668de6d9f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# for Input Union

input Cat {
  name: String!
}

input Dog {
  name: String!
}

input Bird {
  name: String!
}

# Main APi

enum CityID {
  Paris
  BLN
  HH
}

input Coordinates {
  latitude: Euro!
  longitude: [[[UniqueID!]!]]!
}

input UniqueID {
  type: String,
  id: String!
}

type Address {
  city: String!
  street: String!
  houseNumber: Int!
}

type User {
  name: String!
  email: String!
  address(coordinates: Coordinates!, comment: String): Address!
  office(zipCode: [[[ID!]]!], id: CityID!): Address!
  entity: MyUnion!
  home: CityID!
}

union MyUnion = User | Address

type Query {
  user: User!
  animal(animal: Animal): String!
  wrapped1(type: UniqueID): AIntText!
  wrapped2: AText!
  set: SetInt!
  map: MapTextInt!
}

type Mutation {
  createUser: User!
  createAddress: Address!
}

type Subscription {
  newAddress: Address!
  newUser: User!
}