Skip to content

Instantly share code, notes, and snippets.

@hpoit
Last active April 8, 2019 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hpoit/846f68ae0318b8a59ae4dab041b3e8f7 to your computer and use it in GitHub Desktop.
Save hpoit/846f68ae0318b8a59ae4dab041b3e8f7 to your computer and use it in GitHub Desktop.
GraphQL_schemas_and_types.jl
# Object types and fields
struct Character
name::String
appearsIn::EpisodeArray
end
# Arguments
mutable struct Starship
id::ID
name::String
length::Float
end
# Query and mutation types
mutable struct Schema
query::Query
mutation::Mutation
end
# Scalar types (not necessary because Julia already has them?)
# see https://graphql.org/learn/schema/#scalar-types
# Enumeration types (are sets in Julia, also not necessary?)
# see https://graphql.org/learn/schema/#enumeration-types
# Lists and non-null
# SHOULD be used for a null list that can't have null elements, and non-null list that can contain null elements
# not behaving as desired
a = [1, ]
ismissing(a) # a is an Array
# Interfaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment