id: ID!
name: String!
type Photo {
id: ID!
name: String!
url: String!
description: String
rating: Float
private: Boolean!
}
name: String!
description: String
type Query {
totalUsers: Int!
}
type User {
postedPhotos: [Photo!]!
}
photos: [Photo]
photos: [Photo]!
photos: [Photo!]!
Nullable list of nullable values
Non-nullable list of nullable values
Non-nullable list of non-nullable values
enum PhotoCategory {
PORTRAIT
ACTION
LANDSCAPE
}
type Photo {
postedBy: User!
}
type User {
postedPhotos: [Photo!]!
}
type Student {
schedule: [Course!]!
}
type Course {
students: [Student!]!
}
type City {
name: String!
connections: [City!]!
}
BOISE
SUN VALLEY
BEND
155 MILES
318 MILES
type City {
name: String!
connections: [Connection!]!
}
type Connection {
distance: Int!
to: City!
}
BOISE
SUN VALLEY
155 MILES
BEND
318 MILES
type Mutation {
postPhoto: Boolean!
}
type Mutation {
postPhoto (name: String!): Photo!
}
input PostPhotoInput {
name: String!
category: PhotoCategory=PORTRAIT
description: String
}
mutation addPhoto ($input: PostPhotoInput!) {
postPhoto(input: $input) {
id
name
url
}
}
{
"input": {
"name": "Desert Sunset",
"description": "Sunset over Sedona",
"category": "LANDSCAPE"
}
}
Query Variables
type Subscription {
newPhoto: Photo!
}
scalar DateTime
type Photo {
created: DateTime!
updated: DateTime!
}