Skip to content

Instantly share code, notes, and snippets.

@hsyed
Created June 16, 2017 15:11
Show Gist options
  • Save hsyed/5bef1a0b2f400fd4c1bfad2471f7a81a to your computer and use it in GitHub Desktop.
Save hsyed/5bef1a0b2f400fd4c1bfad2471f7a81a to your computer and use it in GitHub Desktop.
type AdminM {
# schema mutations
schema: SchemaNodeM!
}
type AdminQ {
# details about this org
info: Org!
# schema queries
schema: SchemaNodeQ!
}
input AxCreateOrgInput {
idUrl: String!
enabled: Boolean!
clientMutationId: String
}
type AxCreateOrgPayload {
org: AxOrg
clientMutationId: String
}
input AxCreateUserInput {
accountId: String!
enabled: Boolean!
admin: Boolean!
orgId: ID!
clientMutationId: String
}
type AxCreateUserPayload {
user: AxUser
clientMutationId: String
}
type AxOrg implements Node {
# The ID of an object
id: ID!
idUrl: String!
enabled: Boolean!
users(before: String, after: String, first: Int, last: Int): AxUserConnection!
}
# A connection to a list of items.
type AxOrgConnection {
# Information to aid in pagination.
pageInfo: PageInfo!
# A list of edges.
edges: [AxOrgEdge]
}
# An edge in a connection.
type AxOrgEdge {
# The item at the end of the edge.
node: AxOrg!
# A cursor for use in pagination.
cursor: String!
}
# if this is a tenant schema add extension fields to the axsy provided types
input AxSchemaAddExtensionFieldsOperation {
typeName: String!
fields: [AxSchemaFieldInput!]!
}
# add fields to types in the schema
input AxSchemaAddFieldsOperation {
typeName: String!
fields: [AxSchemaFieldInput!]!
}
type AxSchemaField {
# The name of the field
name: String!
# A comment describing the field
comment: String!
# The scalar type of the field
type: String!
# is the field required
required: Boolean!
# is the field repeated
repeated: Boolean!
}
input AxSchemaFieldInput {
# The name of the field
name: String!
# A comment describing the field
comment: String!
# The scalar type of the field
type: String!
# is the field required
required: Boolean!
# is the field repeated
repeated: Boolean!
}
# A schema change transaction. Remove operations are applied before add operations
input AxSchemaModification {
# add types to the schema
addTypes: [AxSchemaTypeInput!] = []
# remove existing types from the schema
removeTypes: [String!] = []
# add fields to types in the schema
addFields: [AxSchemaAddFieldsOperation!] = []
# if this is a tenant schema add extension fields to the axsy provided types
addExtensionFields: [AxSchemaAddExtensionFieldsOperation!] = []
# remove fields from this schema
removeFields: [AxSchemaRemoveFieldsOperation!] = []
# if this is a tenant schema remove extension fields from the axsy provided types
removeExtensionFields: [AxSchemaRemoveExtensionFieldsOperation!] = []
}
# if this is a tenant schema remove extension fields from the axsy provided types
input AxSchemaRemoveExtensionFieldsOperation {
typeName: String!
fieldNames: [String!]!
}
# remove fields from this schema
input AxSchemaRemoveFieldsOperation {
typeName: String!
fieldNames: [String!]!
}
type AxSchemaType {
# The name of the type
name: String!
# A comment describing the type
comment: String!
# The Fields of this type
fields: [AxSchemaField!]!
}
input AxSchemaTypeInput {
# The name of the type
name: String!
# A comment describing the type
comment: String!
# The fields of the type
fields: [AxSchemaFieldInput!]!
}
# A schema change transaction. Remove operations are applied before add operations
input AxSystemSchemaModification {
# add types to the schema
addTypes: [AxSchemaTypeInput!] = []
# remove existing types from the schema
removeTypes: [String!] = []
# add fields to types in the schema
addFields: [AxSchemaAddFieldsOperation!] = []
# remove fields from this schema
removeFields: [AxSchemaRemoveFieldsOperation!] = []
}
type AxUser implements Node {
# The ID of an object
id: ID!
accountId: String!
enabled: Boolean!
admin: Boolean!
}
# A connection to a list of items.
type AxUserConnection {
# Information to aid in pagination.
pageInfo: PageInfo!
# A list of edges.
edges: [AxUserEdge]
}
# An edge in a connection.
type AxUserEdge {
# The item at the end of the edge.
node: AxUser!
# A cursor for use in pagination.
cursor: String!
}
# The `BigDecimal` scalar type represents signed fractional values with arbitrary precision.
scalar BigDecimal
# The `BigInt` scalar type represents non-fractional signed whole numeric values. BigInt can represent arbitrary big values.
scalar BigInt
# The `Long` scalar type represents non-fractional signed whole numeric values.
# Long can represent values between -(2^63) and 2^63 - 1.
scalar Long
type Mutation {
createUser(input: AxCreateUserInput!): AxCreateUserPayload
createOrg(input: AxCreateOrgInput!): AxCreateOrgPayload
# The system api group
system: SystemApiGroupM!
}
# An object with an ID
interface Node {
# The id of the object.
id: ID!
}
# An Organization
type Org {
# An ID field that uniquely identifies an org. This should be formatted as a valid hostname.
idUrl: String!
# Is this entity enabled.
enabled: Boolean!
}
# An Organization
input OrgInput {
# An ID field that uniquely identifies an org. This should be formatted as a valid hostname.
idUrl: String!
# Is this entity enabled.
enabled: Boolean = true
}
# Information about pagination in a connection.
type PageInfo {
# When paginating forwards, are there more items?
hasNextPage: Boolean!
# When paginating backwards, are there more items?
hasPreviousPage: Boolean!
# When paginating backwards, the cursor to continue.
startCursor: String
# When paginating forwards, the cursor to continue.
endCursor: String
}
type Query {
# Fetches an object given its ID
node(
# The ID of an object
id: ID!
): Node
# Fetches objects given their IDs
nodes(
# The IDs of objects
ids: [ID!]!
): [Node]!
orgs(before: String, after: String, first: Int, last: Int): AxOrgConnection!
users(before: String, after: String, first: Int, last: Int): AxUserConnection!
# The system api group
system: SystemApiGroupQ!
}
type SchemaNodeM {
create_type(model: AxSchemaTypeInput!): String
# apply a change transaction to this schema
modify(
# the transaction
change: AxSchemaModification!
): String
}
type SchemaNodeQ {
# list the types in this tenants schema
types: [AxSchemaType!]!
}
type SystemApiGroupM {
# The tenants api group
tenants: SystemTenantsControllerM!
# become a tenant admin
tenant(
# TenantIdUrl
idUrl: String!
): AdminM
# system schema api group
schema: SystemSchemaNodeM!
}
type SystemApiGroupQ {
# The tenants api group
tenants: SystemTenantsControllerQ!
# become a tenant admin
tenant(
# TenantIdUrl
idUrl: String!
): AdminQ
# system schema api group
schema: SystemSchemaNodeQ!
}
type SystemSchemaNodeM {
create_type(model: AxSchemaTypeInput!): String
# apply a change transaction to this schema
modify(
# the transaction
change: AxSystemSchemaModification!
): String
}
type SystemSchemaNodeQ {
# list the types in this tenants schema
types: [AxSchemaType!]!
}
type SystemTenantsControllerM {
# initialize a new tenant
create_tenant(
# The org to create
value: OrgInput!
): String!
}
type SystemTenantsControllerQ {
# List tenants
list: [Org!]!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment