Skip to content

Instantly share code, notes, and snippets.

@flovilmart
Created March 26, 2017 21:24
Show Gist options
  • Save flovilmart/8f5054345868c23b36765964d2d02b3e to your computer and use it in GitHub Desktop.
Save flovilmart/8f5054345868c23b36765964d2d02b3e to your computer and use it in GitHub Desktop.
GraphQL Parse Schema
mutation {
NewClass {
create(foo: "hello", bar: false, increment: 1) {
objectId, foo, bar, increment
}
}
}
mutation {
create(className: "NewClass", params: {foo: "Bar", bar: true, increment: 10}) {
objectId,
createdAt,
updatedAt,
... on NewClass { foo }
}
}
mutation {
create(className: "NonExistantSchema", params: { foo: "Bar", bar: "baz" }) {
objectId,
createdAt,
updatedAt,
... on Object { data }
}
}
mutation myMutation($id: ID!) {
NewClass {
update(objectId: $id, incrementKey: { key: "increment", value: 2 }) {
objectId, increment
}
}
}
query {
OtherClass {
objectId,
baz {
foo
}
}
}
schema {
query: ParseSchema
mutation: ParseSchemaMutation
}
# Parse Class _Role
type _Role implements ObjectType {
# Accessor for objectId (String)
objectId: ID!
# Accessor for createdAt (Date)
createdAt: Date
# Accessor for updatedAt (Date)
updatedAt: Date
# Accessor for ACL (ACL)
ACL: ACL
# Accessor for name (String)
name: String
}
type _RoleMutation {
create(
# Setter for ACL (ACL)
ACL: ACL
# Setter for name (String)
name: String
): _Role
update(
objectId: ID!
# Setter for ACL (ACL)
ACL: ACL
# Setter for name (String)
name: String
incrementKey: FloatConstraint
unsetKey: String
): _Role
destroy(id: ID!): _Role
destroyAll(ids: [ID!]!): _Role
}
# Parse Class _User
type _User implements ObjectType {
# Accessor for objectId (String)
objectId: ID!
# Accessor for createdAt (Date)
createdAt: Date
# Accessor for updatedAt (Date)
updatedAt: Date
# Accessor for ACL (ACL)
ACL: ACL
# Accessor for username (String)
username: String
# Accessor for password (String)
password: String
# Accessor for email (String)
email: String
# Accessor for emailVerified (Boolean)
emailVerified: Boolean
}
type _UserMutation {
create(
# Setter for ACL (ACL)
ACL: ACL
# Setter for username (String)
username: String
# Setter for password (String)
password: String
# Setter for email (String)
email: String
# Setter for emailVerified (Boolean)
emailVerified: Boolean
): _User
update(
objectId: ID!
# Setter for ACL (ACL)
ACL: ACL
# Setter for username (String)
username: String
# Setter for password (String)
password: String
# Setter for email (String)
email: String
# Setter for emailVerified (Boolean)
emailVerified: Boolean
incrementKey: FloatConstraint
unsetKey: String
): _User
destroy(id: ID!): _User
destroyAll(ids: [ID!]!): _User
}
scalar ACL
scalar Date
input FloatConstraint {
key: String
value: Float
}
scalar JSONObject
# Parse Class NewClass
type NewClass implements ObjectType {
# Accessor for objectId (String)
objectId: ID!
# Accessor for createdAt (Date)
createdAt: Date
# Accessor for updatedAt (Date)
updatedAt: Date
# Accessor for ACL (ACL)
ACL: ACL
# Accessor for foo (String)
foo: String
# Accessor for bar (Boolean)
bar: Boolean
# Accessor for increment (Number)
increment: Float
}
type NewClassMutation {
create(
# Setter for ACL (ACL)
ACL: ACL
# Setter for foo (String)
foo: String
# Setter for bar (Boolean)
bar: Boolean
# Setter for increment (Number)
increment: Float
): NewClass
update(
objectId: ID!
# Setter for ACL (ACL)
ACL: ACL
# Setter for foo (String)
foo: String
# Setter for bar (Boolean)
bar: Boolean
# Setter for increment (Number)
increment: Float
incrementKey: FloatConstraint
unsetKey: String
): NewClass
destroy(id: ID!): NewClass
destroyAll(ids: [ID!]!): NewClass
}
type Object implements ObjectType {
objectId: ID!
createdAt: Date
updatedAt: Date
ACL: ACL
data: JSONObject
}
interface ObjectType {
objectId: ID!
createdAt: Date
updatedAt: Date
ACL: ACL
}
# Parse Class OtherClass
type OtherClass implements ObjectType {
# Accessor for objectId (String)
objectId: ID!
# Accessor for createdAt (Date)
createdAt: Date
# Accessor for updatedAt (Date)
updatedAt: Date
# Accessor for ACL (ACL)
ACL: ACL
# Accessor for foo (String)
foo: String
baz: NewClass
}
type OtherClassMutation {
create(
# Setter for ACL (ACL)
ACL: ACL
# Setter for foo (String)
foo: String
# Setter for baz (Pointer)
baz: Pointer
): OtherClass
update(
objectId: ID!
# Setter for ACL (ACL)
ACL: ACL
# Setter for foo (String)
foo: String
# Setter for baz (Pointer)
baz: Pointer
incrementKey: FloatConstraint
unsetKey: String
): OtherClass
destroy(id: ID!): OtherClass
destroyAll(ids: [ID!]!): OtherClass
}
# The full parse schema
type ParseSchema {
_Role(
id: ID
# Setter for ACL (ACL)
ACL: ACL
# Setter for name (String)
name: String
whereLessThan: FloatConstraint
whereGreaterThan: FloatConstraint
whereLessThanOrEqualTo: FloatConstraint
whereGreaterThanOrEqualTo: FloatConstraint
whereMatches: StringConstraint
whereExists: String
whereDoesNotExist: String
whereStartsWith: StringConstraint
whereEndsWith: StringConstraint
): [_Role]
_User(
id: ID
# Setter for ACL (ACL)
ACL: ACL
# Setter for username (String)
username: String
# Setter for password (String)
password: String
# Setter for email (String)
email: String
# Setter for emailVerified (Boolean)
emailVerified: Boolean
whereLessThan: FloatConstraint
whereGreaterThan: FloatConstraint
whereLessThanOrEqualTo: FloatConstraint
whereGreaterThanOrEqualTo: FloatConstraint
whereMatches: StringConstraint
whereExists: String
whereDoesNotExist: String
whereStartsWith: StringConstraint
whereEndsWith: StringConstraint
): [_User]
NewClass(
id: ID
# Setter for ACL (ACL)
ACL: ACL
# Setter for foo (String)
foo: String
# Setter for bar (Boolean)
bar: Boolean
# Setter for increment (Number)
increment: Float
whereLessThan: FloatConstraint
whereGreaterThan: FloatConstraint
whereLessThanOrEqualTo: FloatConstraint
whereGreaterThanOrEqualTo: FloatConstraint
whereMatches: StringConstraint
whereExists: String
whereDoesNotExist: String
whereStartsWith: StringConstraint
whereEndsWith: StringConstraint
): [NewClass]
OtherClass(
id: ID
# Setter for ACL (ACL)
ACL: ACL
# Setter for foo (String)
foo: String
# Setter for baz (Pointer)
baz: Pointer
whereLessThan: FloatConstraint
whereGreaterThan: FloatConstraint
whereLessThanOrEqualTo: FloatConstraint
whereGreaterThanOrEqualTo: FloatConstraint
whereMatches: StringConstraint
whereExists: String
whereDoesNotExist: String
whereStartsWith: StringConstraint
whereEndsWith: StringConstraint
): [OtherClass]
ParseObject: Object
}
type ParseSchemaMutation {
_Role: _RoleMutation
_User: _UserMutation
NewClass: NewClassMutation
OtherClass: OtherClassMutation
create(className: String!, params: JSONObject!): ObjectType
}
scalar Pointer
input StringConstraint {
key: String
value: String
}
@flovilmart
Copy link
Author

Everything is auto-generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment