github.com/opiuman/genqlient@v1.0.0/generate/testdata/queries/schema.graphql (about) 1 """DateTime is a scalar. 2 3 We don't really have anything useful to do with this description though. 4 """ 5 scalar DateTime 6 scalar Date 7 scalar Junk 8 scalar ComplexJunk 9 10 """Role is a type a user may have.""" 11 enum Role { 12 """What is a student? 13 14 A student is primarily a person enrolled in a school or other educational institution and who is under learning with goals of acquiring knowledge, developing professions and achieving employment at desired field. In the broader sense, a student is anyone who applies themselves to the intensive intellectual engagement with some matter necessary to master it as part of some practical affair in which such mastery is basic or decisive. 15 16 (from [Wikipedia](https://en.wikipedia.org/wiki/Student)) 17 """ 18 STUDENT 19 20 """Teacher is a teacher, who teaches the students.""" 21 TEACHER 22 } 23 24 input PokemonInput { 25 species: String! 26 level: Int! 27 } 28 29 type Pokemon { 30 species: String! 31 level: Int! 32 } 33 34 """UserQueryInput is the argument to Query.users. 35 36 Ideally this would support anything and everything! 37 Or maybe ideally it wouldn't. 38 Really I'm just talking to make this documentation longer. 39 """ 40 input UserQueryInput { 41 email: String 42 name: String 43 """id looks the user up by ID. It's a great way to look up users.""" 44 id: ID 45 role: Role 46 names: [String] 47 hasPokemon: PokemonInput 48 birthdate: Date 49 } 50 51 type AuthMethod { 52 provider: String 53 email: String 54 } 55 56 """A User is a user!""" 57 type User { 58 """id is the user's ID. 59 60 It is stable, unique, and opaque, like all good IDs.""" 61 id: ID! 62 roles: [Role!] 63 name: String 64 emails: [String!]! 65 emailsOrNull: [String!] 66 emailsWithNulls: [String]! 67 emailsWithNullsOrNull: [String] 68 authMethods: [AuthMethod!]! 69 pokemon: [Pokemon!] 70 greeting: Clip 71 birthdate: Date 72 } 73 74 """An audio clip, such as of a user saying hello.""" 75 type Clip implements HasDuration { 76 id: ID! 77 duration: Int! 78 } 79 80 """Content is implemented by various types like Article, Video, and Topic.""" 81 interface Content { 82 """ID is the identifier of the content.""" 83 id: ID! 84 name: String! 85 parent: Topic 86 url: String! 87 } 88 89 """An object with a duration, like a video.""" 90 interface HasDuration { 91 duration: Int! 92 } 93 94 """LeafContent represents content items that can't have child-nodes.""" 95 union LeafContent = Article | Video 96 97 type Article implements Content { 98 """ID is documented in the Content interface.""" 99 id: ID! 100 name: String! 101 parent: Topic! 102 url: String! 103 text: String! 104 thumbnail: StuffThumbnail 105 } 106 107 type StuffThumbnail { # for articles, but let's give the name-generator a hard time. 108 id: ID! 109 thumbnailUrl: String! 110 } 111 112 type Video implements Content & HasDuration { 113 """ID is documented in the Content interface.""" 114 id: ID! 115 name: String! 116 parent: Topic! 117 url: String! 118 duration: Int! 119 thumbnail: Thumbnail 120 } 121 122 type Thumbnail { # for videos, but let's give the name-generator a hard time. 123 id: ID! 124 timestampSec: Int! 125 } 126 127 type Topic implements Content { 128 """ID is documented in the Content interface.""" 129 id: ID! 130 name: String! 131 parent: Topic 132 url: String! 133 children: [Content!]! 134 videoChildren: [Video!]! 135 schoolGrade: String 136 } 137 138 input RecursiveInput { 139 rec: [RecursiveInput] 140 } 141 142 type Recursive { 143 id: ID! 144 rec: Recursive 145 } 146 147 """Query's description is probably ignored by almost all callers.""" 148 type Query { 149 """user looks up a user by some stuff. 150 151 See UserQueryInput for what stuff is supported. 152 If query is null, returns the current user. 153 """ 154 user(query: UserQueryInput): User 155 156 users(query: [UserQueryInput]): [User] 157 158 """usersWithRole looks a user up by role.""" 159 usersWithRole(role: Role!): [User!]! 160 161 usersBornOn(date: Date!): [User!]! 162 163 root: Topic! 164 randomItem: Content! 165 randomLeaf: LeafContent! 166 randomVideo: Video! 167 convert(dt: DateTime!, tz: String): DateTime! 168 maybeConvert(dt: DateTime, tz: String): DateTime 169 getJunk: Junk 170 getComplexJunk: ComplexJunk 171 listOfListsOfLists: [[[String!]!]!]! 172 listOfListsOfListsOfContent: [[[Content!]!]!]! 173 recur(input: RecursiveInput!): Recursive 174 acceptsListOfListOfListsOfDates(datesss: [[[Date!]!]!]!): Boolean 175 } 176 177 type Mutation { 178 createUser(name: String!, email: String): User 179 }