mirror of
https://github.com/ash-project/ash_graphql.git
synced 2024-09-20 05:13:33 +12:00
333 lines
6.1 KiB
GraphQL
333 lines
6.1 KiB
GraphQL
schema {
|
|
mutation: RootMutationType
|
|
query: RootQueryType
|
|
}
|
|
|
|
"The result of the :assign_posts mutation"
|
|
type AssignPostsResult {
|
|
"The successful result of the mutation"
|
|
result: User
|
|
|
|
"Any errors generated, if the mutation failed"
|
|
errors: [MutationError!]!
|
|
}
|
|
|
|
input AssignPostsInput {
|
|
name: String
|
|
postIds: [ID!]
|
|
}
|
|
|
|
"The result of the :create_user mutation"
|
|
type CreateUserResult {
|
|
"The successful result of the mutation"
|
|
result: User
|
|
|
|
"Any errors generated, if the mutation failed"
|
|
errors: [MutationError!]!
|
|
}
|
|
|
|
input CreateUserInput {
|
|
name: String
|
|
}
|
|
|
|
input UserFilterName {
|
|
isNil: Boolean
|
|
eq: String
|
|
notEq: String
|
|
in: [String]
|
|
lessThan: String
|
|
greaterThan: String
|
|
lessThanOrEqual: String
|
|
greaterThanOrEqual: String
|
|
}
|
|
|
|
input UserFilterId {
|
|
isNil: Boolean
|
|
eq: ID
|
|
notEq: ID
|
|
in: [ID!]
|
|
lessThan: ID
|
|
greaterThan: ID
|
|
lessThanOrEqual: ID
|
|
greaterThanOrEqual: ID
|
|
}
|
|
|
|
input UserFilterInput {
|
|
and: [UserFilterInput!]
|
|
or: [UserFilterInput!]
|
|
not: [UserFilterInput!]
|
|
id: UserFilterId
|
|
name: UserFilterName
|
|
posts: PostFilterInput
|
|
}
|
|
|
|
type User implements Node {
|
|
id: ID!
|
|
name: String
|
|
posts(
|
|
"How to sort the records in the response"
|
|
sort: [PostSortInput]
|
|
|
|
"A filter to limit the results"
|
|
filter: PostFilterInput
|
|
|
|
"The number of records to return."
|
|
limit: Int
|
|
|
|
"The number of records to skip."
|
|
offset: Int
|
|
): [Post!]!
|
|
}
|
|
|
|
"The result of the :create_resource mutation"
|
|
type CreateResourceResult {
|
|
"The successful result of the mutation"
|
|
result: ResourceWithNoPrimaryKeyGet
|
|
|
|
"Any errors generated, if the mutation failed"
|
|
errors: [MutationError!]!
|
|
}
|
|
|
|
input CreateResourceInput {
|
|
name: String!
|
|
}
|
|
|
|
type ResourceWithNoPrimaryKeyGet implements Node {
|
|
id: ID!
|
|
name: String!
|
|
posts(
|
|
"How to sort the records in the response"
|
|
sort: [PostSortInput]
|
|
|
|
"A filter to limit the results"
|
|
filter: PostFilterInput
|
|
|
|
"The number of records to return."
|
|
limit: Int
|
|
|
|
"The number of records to skip."
|
|
offset: Int
|
|
): [Post!]!
|
|
}
|
|
|
|
"The result of the :delete_post mutation"
|
|
type DeletePostResult {
|
|
"The record that was successfully deleted"
|
|
result: Post
|
|
|
|
"Any errors generated, if the mutation failed"
|
|
errors: [MutationError!]!
|
|
}
|
|
|
|
"The result of the :assign_author mutation"
|
|
type AssignAuthorResult {
|
|
"The successful result of the mutation"
|
|
result: Post
|
|
|
|
"Any errors generated, if the mutation failed"
|
|
errors: [MutationError!]!
|
|
}
|
|
|
|
input AssignAuthorInput {
|
|
text: String
|
|
authorId: ID
|
|
}
|
|
|
|
"The result of the :update_post mutation"
|
|
type UpdatePostResult {
|
|
"The successful result of the mutation"
|
|
result: Post
|
|
|
|
"Any errors generated, if the mutation failed"
|
|
errors: [MutationError!]!
|
|
}
|
|
|
|
input UpdatePostInput {
|
|
text: String
|
|
authorId: ID
|
|
}
|
|
|
|
"The result of the :simple_create_post mutation"
|
|
type SimpleCreatePostResult {
|
|
"The successful result of the mutation"
|
|
result: Post
|
|
|
|
"Any errors generated, if the mutation failed"
|
|
errors: [MutationError!]!
|
|
}
|
|
|
|
input SimpleCreatePostInput {
|
|
text: String
|
|
authorId: ID
|
|
}
|
|
|
|
enum PostSortField {
|
|
ID
|
|
TEXT
|
|
AUTHOR_ID
|
|
}
|
|
|
|
"A keyset page of :post"
|
|
type KeysetPageOfPost {
|
|
"Total count on all pages"
|
|
count: Int
|
|
|
|
"The records contained in the page"
|
|
results: [Post!]
|
|
|
|
"The first keyset in the results"
|
|
startKeyset: String
|
|
|
|
"The last keyset in the results"
|
|
endKeyset: String
|
|
}
|
|
|
|
input PostFilterAuthorId {
|
|
isNil: Boolean
|
|
eq: ID
|
|
notEq: ID
|
|
in: [ID]
|
|
lessThan: ID
|
|
greaterThan: ID
|
|
lessThanOrEqual: ID
|
|
greaterThanOrEqual: ID
|
|
}
|
|
|
|
input PostFilterText {
|
|
isNil: Boolean
|
|
eq: String
|
|
notEq: String
|
|
in: [String]
|
|
lessThan: String
|
|
greaterThan: String
|
|
lessThanOrEqual: String
|
|
greaterThanOrEqual: String
|
|
}
|
|
|
|
input PostFilterId {
|
|
isNil: Boolean
|
|
eq: ID
|
|
notEq: ID
|
|
in: [ID!]
|
|
lessThan: ID
|
|
greaterThan: ID
|
|
lessThanOrEqual: ID
|
|
greaterThanOrEqual: ID
|
|
}
|
|
|
|
input PostFilterInput {
|
|
and: [PostFilterInput!]
|
|
or: [PostFilterInput!]
|
|
not: [PostFilterInput!]
|
|
id: PostFilterId
|
|
text: PostFilterText
|
|
authorId: PostFilterAuthorId
|
|
author: UserFilterInput
|
|
}
|
|
|
|
input PostSortInput {
|
|
order: SortOrder
|
|
field: PostSortField!
|
|
}
|
|
|
|
type Post implements Node {
|
|
id: ID!
|
|
text: String
|
|
authorId: ID
|
|
author: User
|
|
}
|
|
|
|
"A relay node"
|
|
interface Node {
|
|
"A unique identifier"
|
|
id: ID!
|
|
}
|
|
|
|
enum SortOrder {
|
|
DESC
|
|
DESC_NULLS_FIRST
|
|
DESC_NULLS_LAST
|
|
ASC
|
|
ASC_NULLS_FIRST
|
|
ASC_NULLS_LAST
|
|
}
|
|
|
|
"An error generated by a failed mutation"
|
|
type MutationError {
|
|
"The human readable error message"
|
|
message: String
|
|
|
|
"A shorter error message, with vars not replaced"
|
|
shortMessage: String
|
|
|
|
"Replacements for the short message"
|
|
vars: Json
|
|
|
|
"An error code for the given error"
|
|
code: String
|
|
|
|
"The field or fields that produced the error"
|
|
fields: [String!]
|
|
}
|
|
|
|
type RootQueryType {
|
|
"Retrieves a Node from its global id"
|
|
node(
|
|
"The Node unique identifier"
|
|
id: ID!
|
|
): Node!
|
|
|
|
getPost(
|
|
"The id of the record"
|
|
id: ID!
|
|
): Post
|
|
|
|
postLibrary(
|
|
"How to sort the records in the response"
|
|
sort: [PostSortInput]
|
|
|
|
"A filter to limit the results"
|
|
filter: PostFilterInput
|
|
|
|
"The number of records to return from the beginning. Maximum 250"
|
|
first: Int
|
|
|
|
"Show records before the specified keyset."
|
|
before: String
|
|
|
|
"Show records after the specified keyset."
|
|
after: String
|
|
|
|
"The number of records to return to the end. Maximum 250"
|
|
last: Int
|
|
): KeysetPageOfPost
|
|
|
|
getResourceByName(
|
|
"The id of the record"
|
|
id: ID!
|
|
|
|
name: String
|
|
): ResourceWithNoPrimaryKeyGet
|
|
|
|
getUser(
|
|
"The id of the record"
|
|
id: ID!
|
|
): User
|
|
}
|
|
|
|
type RootMutationType {
|
|
simpleCreatePost(input: SimpleCreatePostInput): SimpleCreatePostResult!
|
|
updatePost(id: ID!, input: UpdatePostInput): UpdatePostResult!
|
|
assignAuthor(id: ID!, input: AssignAuthorInput): AssignAuthorResult!
|
|
deletePost(id: ID!): DeletePostResult!
|
|
createResource(input: CreateResourceInput!): CreateResourceResult!
|
|
createUser(input: CreateUserInput): CreateUserResult!
|
|
assignPosts(id: ID!, input: AssignPostsInput): AssignPostsResult!
|
|
}
|
|
|
|
"""
|
|
The `Json` scalar type represents arbitrary json string data, represented as UTF-8
|
|
character sequences. The Json type is most often used to represent a free-form
|
|
human-readable json string.
|
|
"""
|
|
scalar Json
|