diff --git a/graphile/graphile-schema/src/build-schema.ts b/graphile/graphile-schema/src/build-schema.ts index 9921fda200..ff5ed78417 100644 --- a/graphile/graphile-schema/src/build-schema.ts +++ b/graphile/graphile-schema/src/build-schema.ts @@ -1,5 +1,5 @@ import deepmerge from 'deepmerge' -import { printSchema } from 'graphql' +import { lexicographicSortSchema, printSchema } from 'graphql' import { ConstructivePreset, makePgService } from 'graphile-settings' import { makeSchema } from 'graphile-build' import { getPgPool } from 'pg-cache' @@ -49,5 +49,5 @@ export async function buildSchemaSDL(opts: BuildSchemaOptions): Promise } const { schema } = await makeSchema(preset) - return printSchema(schema) + return printSchema(lexicographicSortSchema(schema)) } diff --git a/graphql/server-test/__tests__/__snapshots__/schema-snapshot.test.ts.snap b/graphql/server-test/__tests__/__snapshots__/schema-snapshot.test.ts.snap index 4e7bbdd71f..5b0bc63aff 100644 --- a/graphql/server-test/__tests__/__snapshots__/schema-snapshot.test.ts.snap +++ b/graphql/server-test/__tests__/__snapshots__/schema-snapshot.test.ts.snap @@ -1,97 +1,61 @@ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing exports[`Schema Snapshot should generate consistent GraphQL SDL from the test schema 1`] = ` -""""The root query type which gives access points into the data universe.""" -type Query { - """Reads and enables pagination through a set of \`PostTag\`.""" - postTags( - """Only read the first \`n\` values of the set.""" - first: Int +"""" +A filter to be used against Boolean fields. All fields are combined with a logical ‘and.’ +""" +input BooleanFilter { + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: Boolean - """Only read the last \`n\` values of the set.""" - last: Int + """Equal to the specified value.""" + equalTo: Boolean - """ - Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor - based pagination. May not be used with \`last\`. - """ - offset: Int + """Greater than the specified value.""" + greaterThan: Boolean - """Read all values in the set before (above) this cursor.""" - before: Cursor + """Greater than or equal to the specified value.""" + greaterThanOrEqualTo: Boolean - """Read all values in the set after (below) this cursor.""" - after: Cursor + """Included in the specified list.""" + in: [Boolean!] - """ - A filter to be used in determining which values should be returned by the collection. - """ - where: PostTagFilter + """ + Is null (if \`true\` is specified) or is not null (if \`false\` is specified). + """ + isNull: Boolean - """The method to use when ordering \`PostTag\`.""" - orderBy: [PostTagOrderBy!] = [PRIMARY_KEY_ASC] - ): PostTagConnection + """Less than the specified value.""" + lessThan: Boolean - """Reads and enables pagination through a set of \`Tag\`.""" - tags( - """Only read the first \`n\` values of the set.""" - first: Int + """Less than or equal to the specified value.""" + lessThanOrEqualTo: Boolean - """Only read the last \`n\` values of the set.""" - last: Int + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: Boolean - """ - Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor - based pagination. May not be used with \`last\`. - """ - offset: Int + """Not equal to the specified value.""" + notEqualTo: Boolean - """Read all values in the set before (above) this cursor.""" - before: Cursor + """Not included in the specified list.""" + notIn: [Boolean!] +} + +type Comment { + """Reads a single \`User\` that is related to this \`Comment\`.""" + author: User + authorId: UUID! + """Reads and enables pagination through a set of \`Comment\`.""" + childComments( """Read all values in the set after (below) this cursor.""" after: Cursor - """ - A filter to be used in determining which values should be returned by the collection. - """ - where: TagFilter - - """The method to use when ordering \`Tag\`.""" - orderBy: [TagOrderBy!] = [PRIMARY_KEY_ASC] - ): TagConnection - - """Reads and enables pagination through a set of \`User\`.""" - users( - """Only read the first \`n\` values of the set.""" - first: Int - - """Only read the last \`n\` values of the set.""" - last: Int - - """ - Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor - based pagination. May not be used with \`last\`. - """ - offset: Int - """Read all values in the set before (above) this cursor.""" before: Cursor - """Read all values in the set after (below) this cursor.""" - after: Cursor - - """ - A filter to be used in determining which values should be returned by the collection. - """ - where: UserFilter - - """The method to use when ordering \`User\`.""" - orderBy: [UserOrderBy!] = [PRIMARY_KEY_ASC] - ): UserConnection - - """Reads and enables pagination through a set of \`Comment\`.""" - comments( """Only read the first \`n\` values of the set.""" first: Int @@ -104,1171 +68,1474 @@ type Query { """ offset: Int - """Read all values in the set before (above) this cursor.""" - before: Cursor - - """Read all values in the set after (below) this cursor.""" - after: Cursor - - """ - A filter to be used in determining which values should be returned by the collection. - """ - where: CommentFilter - """The method to use when ordering \`Comment\`.""" orderBy: [CommentOrderBy!] = [PRIMARY_KEY_ASC] - ): CommentConnection - - """Reads and enables pagination through a set of \`Post\`.""" - posts( - """Only read the first \`n\` values of the set.""" - first: Int - - """Only read the last \`n\` values of the set.""" - last: Int - - """ - Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor - based pagination. May not be used with \`last\`. - """ - offset: Int - - """Read all values in the set before (above) this cursor.""" - before: Cursor - - """Read all values in the set after (below) this cursor.""" - after: Cursor """ A filter to be used in determining which values should be returned by the collection. """ - where: PostFilter + where: CommentFilter + ): CommentConnection! + content: String! + createdAt: Datetime + id: UUID! + isApproved: Boolean + likesCount: Int - """The method to use when ordering \`Post\`.""" - orderBy: [PostOrderBy!] = [PRIMARY_KEY_ASC] - ): PostConnection + """Reads a single \`Comment\` that is related to this \`Comment\`.""" + parent: Comment + parentId: UUID - """ - Metadata about the database schema, including tables, fields, indexes, and constraints. Useful for code generation tools. - """ - _meta: MetaSchema + """Reads a single \`Post\` that is related to this \`Comment\`.""" + post: Post + postId: UUID! + updatedAt: Datetime } -"""A connection to a list of \`PostTag\` values.""" -type PostTagConnection { - """A list of \`PostTag\` objects.""" - nodes: [PostTag]! - +"""A connection to a list of \`Comment\` values.""" +type CommentConnection { """ - A list of edges which contains the \`PostTag\` and cursor to aid in pagination. + A list of edges which contains the \`Comment\` and cursor to aid in pagination. """ - edges: [PostTagEdge]! + edges: [CommentEdge]! + + """A list of \`Comment\` objects.""" + nodes: [Comment]! """Information to aid in pagination.""" pageInfo: PageInfo! - """The count of *all* \`PostTag\` you could get from the connection.""" + """The count of *all* \`Comment\` you could get from the connection.""" totalCount: Int! } -type PostTag { - id: UUID! - postId: UUID! - tagId: UUID! - createdAt: Datetime - - """Reads a single \`Post\` that is related to this \`PostTag\`.""" - post: Post +"""A \`Comment\` edge in the connection.""" +type CommentEdge { + """A cursor for use in pagination.""" + cursor: Cursor - """Reads a single \`Tag\` that is related to this \`PostTag\`.""" - tag: Tag + """The \`Comment\` at the end of the edge.""" + node: Comment } """ -A universally unique identifier as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122). -""" -scalar UUID - -""" -A point in time as described by the [ISO -8601](https://en.wikipedia.org/wiki/ISO_8601) and, if it has a timezone, [RFC -3339](https://datatracker.ietf.org/doc/html/rfc3339) standards. Input values -that do not conform to both ISO 8601 and RFC 3339 may be coerced, which may lead -to unexpected results. +A filter to be used against \`Comment\` object types. All fields are combined with a logical ‘and.’ """ -scalar Datetime +input CommentFilter { + """Checks for all expressions in this list.""" + and: [CommentFilter!] -type Post { - id: UUID! - authorId: UUID! - title: String! - slug: String! - content: String - excerpt: String - isPublished: Boolean - publishedAt: Datetime - viewCount: Int - createdAt: Datetime - updatedAt: Datetime + """Filter by the object’s \`author\` relation.""" + author: UserFilter - """Reads and enables pagination through a set of \`Tag\`.""" - tags( - """Only read the first \`n\` values of the set.""" - first: Int + """Filter by the object’s \`authorId\` field.""" + authorId: UUIDFilter - """Only read the last \`n\` values of the set.""" - last: Int + """Filter by the object’s \`childComments\` relation.""" + childComments: CommentToManyCommentFilter - """ - Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor - based pagination. May not be used with \`last\`. - """ - offset: Int + """\`childComments\` exist.""" + childCommentsExist: Boolean - """Read all values in the set before (above) this cursor.""" - before: Cursor + """Filter by the object’s \`content\` field.""" + content: StringFilter - """Read all values in the set after (below) this cursor.""" - after: Cursor + """Filter by the object’s \`createdAt\` field.""" + createdAt: DatetimeFilter - """ - A filter to be used in determining which values should be returned by the collection. - """ - where: TagFilter + """Filter by the object’s \`id\` field.""" + id: UUIDFilter - """The method to use when ordering \`Tag\`.""" - orderBy: [TagOrderBy!] = [PRIMARY_KEY_ASC] - ): PostTagsManyToManyConnection! + """Filter by the object’s \`isApproved\` field.""" + isApproved: BooleanFilter - """Reads a single \`User\` that is related to this \`Post\`.""" - author: User + """Filter by the object’s \`likesCount\` field.""" + likesCount: IntFilter - """Reads and enables pagination through a set of \`PostTag\`.""" - postTags( - """Only read the first \`n\` values of the set.""" - first: Int + """Negates the expression.""" + not: CommentFilter - """Only read the last \`n\` values of the set.""" - last: Int + """Checks for any expressions in this list.""" + or: [CommentFilter!] - """ - Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor - based pagination. May not be used with \`last\`. - """ - offset: Int + """Filter by the object’s \`parent\` relation.""" + parent: CommentFilter - """Read all values in the set before (above) this cursor.""" - before: Cursor + """A related \`parent\` exists.""" + parentExists: Boolean - """Read all values in the set after (below) this cursor.""" - after: Cursor + """Filter by the object’s \`parentId\` field.""" + parentId: UUIDFilter - """ - A filter to be used in determining which values should be returned by the collection. - """ - where: PostTagFilter + """Filter by the object’s \`post\` relation.""" + post: PostFilter - """The method to use when ordering \`PostTag\`.""" - orderBy: [PostTagOrderBy!] = [PRIMARY_KEY_ASC] - ): PostTagConnection! + """Filter by the object’s \`postId\` field.""" + postId: UUIDFilter - """Reads and enables pagination through a set of \`Comment\`.""" - comments( - """Only read the first \`n\` values of the set.""" - first: Int + """Filter by the object’s \`updatedAt\` field.""" + updatedAt: DatetimeFilter +} - """Only read the last \`n\` values of the set.""" - last: Int +"""An input for mutations affecting \`Comment\`""" +input CommentInput { + authorId: UUID! + content: String! + createdAt: Datetime + id: UUID + isApproved: Boolean + likesCount: Int + parentId: UUID + postId: UUID! + updatedAt: Datetime +} - """ - Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor - based pagination. May not be used with \`last\`. - """ - offset: Int +"""Methods to use when ordering \`Comment\`.""" +enum CommentOrderBy { + AUTHOR_ID_ASC + AUTHOR_ID_DESC + CONTENT_ASC + CONTENT_DESC + CREATED_AT_ASC + CREATED_AT_DESC + ID_ASC + ID_DESC + IS_APPROVED_ASC + IS_APPROVED_DESC + LIKES_COUNT_ASC + LIKES_COUNT_DESC + NATURAL + PARENT_ID_ASC + PARENT_ID_DESC + POST_ID_ASC + POST_ID_DESC + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + UPDATED_AT_ASC + UPDATED_AT_DESC +} - """Read all values in the set before (above) this cursor.""" - before: Cursor +""" +Represents an update to a \`Comment\`. Fields that are set will be updated. +""" +input CommentPatch { + authorId: UUID + content: String + createdAt: Datetime + id: UUID + isApproved: Boolean + likesCount: Int + parentId: UUID + postId: UUID + updatedAt: Datetime +} - """Read all values in the set after (below) this cursor.""" - after: Cursor +""" +A filter to be used against many \`Comment\` object types. All fields are combined with a logical ‘and.’ +""" +input CommentToManyCommentFilter { + """Filters to entities where every related entity matches.""" + every: CommentFilter - """ - A filter to be used in determining which values should be returned by the collection. - """ - where: CommentFilter + """Filters to entities where no related entity matches.""" + none: CommentFilter - """The method to use when ordering \`Comment\`.""" - orderBy: [CommentOrderBy!] = [PRIMARY_KEY_ASC] - ): CommentConnection! + """Filters to entities where at least one related entity matches.""" + some: CommentFilter } -"""A connection to a list of \`Tag\` values, with data from \`PostTag\`.""" -type PostTagsManyToManyConnection { - """A list of \`Tag\` objects.""" - nodes: [Tag]! - +"""All input for the create \`Comment\` mutation.""" +input CreateCommentInput { """ - A list of edges which contains the \`Tag\`, info from the \`PostTag\`, and the cursor to aid in pagination. + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. """ - edges: [PostTagsManyToManyEdge!]! - - """Information to aid in pagination.""" - pageInfo: PageInfo! + clientMutationId: String - """The count of *all* \`Tag\` you could get from the connection.""" - totalCount: Int! + """The \`Comment\` to be created by this mutation.""" + comment: CommentInput! } -type Tag { - id: UUID! - name: String! - slug: String! - description: String - color: String - createdAt: Datetime +"""The output of our create \`Comment\` mutation.""" +type CreateCommentPayload { + """ + The exact same \`clientMutationId\` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String - """Reads and enables pagination through a set of \`Post\`.""" - posts( - """Only read the first \`n\` values of the set.""" - first: Int + """The \`Comment\` that was created by this mutation.""" + comment: Comment - """Only read the last \`n\` values of the set.""" - last: Int + """An edge for our \`Comment\`. May be used by Relay 1.""" + commentEdge( + """The method to use when ordering \`Comment\`.""" + orderBy: [CommentOrderBy!]! = [PRIMARY_KEY_ASC] + ): CommentEdge - """ - Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor - based pagination. May not be used with \`last\`. - """ - offset: Int + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} - """Read all values in the set before (above) this cursor.""" - before: Cursor +"""All input for the create \`Post\` mutation.""" +input CreatePostInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String - """Read all values in the set after (below) this cursor.""" - after: Cursor + """The \`Post\` to be created by this mutation.""" + post: PostInput! +} - """ - A filter to be used in determining which values should be returned by the collection. - """ - where: PostFilter +"""The output of our create \`Post\` mutation.""" +type CreatePostPayload { + """ + The exact same \`clientMutationId\` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String + + """The \`Post\` that was created by this mutation.""" + post: Post + """An edge for our \`Post\`. May be used by Relay 1.""" + postEdge( """The method to use when ordering \`Post\`.""" - orderBy: [PostOrderBy!] = [PRIMARY_KEY_ASC] - ): TagPostsManyToManyConnection! + orderBy: [PostOrderBy!]! = [PRIMARY_KEY_ASC] + ): PostEdge - """Reads and enables pagination through a set of \`PostTag\`.""" - postTags( - """Only read the first \`n\` values of the set.""" - first: Int + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} - """Only read the last \`n\` values of the set.""" - last: Int +"""All input for the create \`PostTag\` mutation.""" +input CreatePostTagInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String - """ - Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor - based pagination. May not be used with \`last\`. - """ - offset: Int + """The \`PostTag\` to be created by this mutation.""" + postTag: PostTagInput! +} - """Read all values in the set before (above) this cursor.""" - before: Cursor +"""The output of our create \`PostTag\` mutation.""" +type CreatePostTagPayload { + """ + The exact same \`clientMutationId\` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String - """Read all values in the set after (below) this cursor.""" - after: Cursor - - """ - A filter to be used in determining which values should be returned by the collection. - """ - where: PostTagFilter + """The \`PostTag\` that was created by this mutation.""" + postTag: PostTag + """An edge for our \`PostTag\`. May be used by Relay 1.""" + postTagEdge( """The method to use when ordering \`PostTag\`.""" - orderBy: [PostTagOrderBy!] = [PRIMARY_KEY_ASC] - ): PostTagConnection! -} - -"""A connection to a list of \`Post\` values, with data from \`PostTag\`.""" -type TagPostsManyToManyConnection { - """A list of \`Post\` objects.""" - nodes: [Post]! + orderBy: [PostTagOrderBy!]! = [PRIMARY_KEY_ASC] + ): PostTagEdge """ - A list of edges which contains the \`Post\`, info from the \`PostTag\`, and the cursor to aid in pagination. + Our root query field type. Allows us to run any query from our mutation payload. """ - edges: [TagPostsManyToManyEdge!]! - - """Information to aid in pagination.""" - pageInfo: PageInfo! - - """The count of *all* \`Post\` you could get from the connection.""" - totalCount: Int! + query: Query } -"""A \`Post\` edge in the connection, with data from \`PostTag\`.""" -type TagPostsManyToManyEdge { - """A cursor for use in pagination.""" - cursor: Cursor +"""All input for the create \`Tag\` mutation.""" +input CreateTagInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String - """The \`Post\` at the end of the edge.""" - node: Post - id: UUID! - createdAt: Datetime + """The \`Tag\` to be created by this mutation.""" + tag: TagInput! } -"""A location in a connection that can be used for resuming pagination.""" -scalar Cursor - -"""Information about pagination in a connection.""" -type PageInfo { - """When paginating forwards, are there more items?""" - hasNextPage: Boolean! +"""The output of our create \`Tag\` mutation.""" +type CreateTagPayload { + """ + The exact same \`clientMutationId\` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String - """When paginating backwards, are there more items?""" - hasPreviousPage: Boolean! + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query - """When paginating backwards, the cursor to continue.""" - startCursor: Cursor + """The \`Tag\` that was created by this mutation.""" + tag: Tag - """When paginating forwards, the cursor to continue.""" - endCursor: Cursor + """An edge for our \`Tag\`. May be used by Relay 1.""" + tagEdge( + """The method to use when ordering \`Tag\`.""" + orderBy: [TagOrderBy!]! = [PRIMARY_KEY_ASC] + ): TagEdge } -""" -A filter to be used against \`Post\` object types. All fields are combined with a logical ‘and.’ -""" -input PostFilter { - """Filter by the object’s \`id\` field.""" - id: UUIDFilter - - """Filter by the object’s \`authorId\` field.""" - authorId: UUIDFilter - - """Filter by the object’s \`title\` field.""" - title: StringFilter - - """Filter by the object’s \`slug\` field.""" - slug: StringFilter - - """Filter by the object’s \`content\` field.""" - content: StringFilter - - """Filter by the object’s \`excerpt\` field.""" - excerpt: StringFilter - - """Filter by the object’s \`isPublished\` field.""" - isPublished: BooleanFilter - - """Filter by the object’s \`publishedAt\` field.""" - publishedAt: DatetimeFilter - - """Filter by the object’s \`viewCount\` field.""" - viewCount: IntFilter - - """Filter by the object’s \`createdAt\` field.""" - createdAt: DatetimeFilter - - """Filter by the object’s \`updatedAt\` field.""" - updatedAt: DatetimeFilter - - """Checks for all expressions in this list.""" - and: [PostFilter!] +"""All input for the create \`User\` mutation.""" +input CreateUserInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String - """Checks for any expressions in this list.""" - or: [PostFilter!] + """The \`User\` to be created by this mutation.""" + user: UserInput! +} - """Negates the expression.""" - not: PostFilter +"""The output of our create \`User\` mutation.""" +type CreateUserPayload { + """ + The exact same \`clientMutationId\` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String - """Filter by the object’s \`author\` relation.""" - author: UserFilter + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query - """Filter by the object’s \`postTags\` relation.""" - postTags: PostToManyPostTagFilter + """The \`User\` that was created by this mutation.""" + user: User - """\`postTags\` exist.""" - postTagsExist: Boolean + """An edge for our \`User\`. May be used by Relay 1.""" + userEdge( + """The method to use when ordering \`User\`.""" + orderBy: [UserOrderBy!]! = [PRIMARY_KEY_ASC] + ): UserEdge +} - """Filter by the object’s \`comments\` relation.""" - comments: PostToManyCommentFilter +"""A location in a connection that can be used for resuming pagination.""" +scalar Cursor - """\`comments\` exist.""" - commentsExist: Boolean -} +""" +A point in time as described by the [ISO +8601](https://en.wikipedia.org/wiki/ISO_8601) and, if it has a timezone, [RFC +3339](https://datatracker.ietf.org/doc/html/rfc3339) standards. Input values +that do not conform to both ISO 8601 and RFC 3339 may be coerced, which may lead +to unexpected results. +""" +scalar Datetime """ -A filter to be used against UUID fields. All fields are combined with a logical ‘and.’ +A filter to be used against Datetime fields. All fields are combined with a logical ‘and.’ """ -input UUIDFilter { +input DatetimeFilter { """ - Is null (if \`true\` is specified) or is not null (if \`false\` is specified). + Not equal to the specified value, treating null like an ordinary value. """ - isNull: Boolean + distinctFrom: Datetime """Equal to the specified value.""" - equalTo: UUID - - """Not equal to the specified value.""" - notEqualTo: UUID + equalTo: Datetime - """ - Not equal to the specified value, treating null like an ordinary value. - """ - distinctFrom: UUID + """Greater than the specified value.""" + greaterThan: Datetime - """Equal to the specified value, treating null like an ordinary value.""" - notDistinctFrom: UUID + """Greater than or equal to the specified value.""" + greaterThanOrEqualTo: Datetime """Included in the specified list.""" - in: [UUID!] + in: [Datetime!] - """Not included in the specified list.""" - notIn: [UUID!] + """ + Is null (if \`true\` is specified) or is not null (if \`false\` is specified). + """ + isNull: Boolean """Less than the specified value.""" - lessThan: UUID + lessThan: Datetime """Less than or equal to the specified value.""" - lessThanOrEqualTo: UUID + lessThanOrEqualTo: Datetime - """Greater than the specified value.""" - greaterThan: UUID + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: Datetime - """Greater than or equal to the specified value.""" - greaterThanOrEqualTo: UUID + """Not equal to the specified value.""" + notEqualTo: Datetime + + """Not included in the specified list.""" + notIn: [Datetime!] } -""" -A filter to be used against String fields. All fields are combined with a logical ‘and.’ -""" -input StringFilter { +"""All input for the \`deleteComment\` mutation.""" +input DeleteCommentInput { """ - Is null (if \`true\` is specified) or is not null (if \`false\` is specified). + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. """ - isNull: Boolean - - """Equal to the specified value.""" - equalTo: String - - """Not equal to the specified value.""" - notEqualTo: String + clientMutationId: String + id: UUID! +} +"""The output of our delete \`Comment\` mutation.""" +type DeleteCommentPayload { """ - Not equal to the specified value, treating null like an ordinary value. + The exact same \`clientMutationId\` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. """ - distinctFrom: String + clientMutationId: String - """Equal to the specified value, treating null like an ordinary value.""" - notDistinctFrom: String + """The \`Comment\` that was deleted by this mutation.""" + comment: Comment - """Included in the specified list.""" - in: [String!] + """An edge for our \`Comment\`. May be used by Relay 1.""" + commentEdge( + """The method to use when ordering \`Comment\`.""" + orderBy: [CommentOrderBy!]! = [PRIMARY_KEY_ASC] + ): CommentEdge - """Not included in the specified list.""" - notIn: [String!] - - """Less than the specified value.""" - lessThan: String - - """Less than or equal to the specified value.""" - lessThanOrEqualTo: String - - """Greater than the specified value.""" - greaterThan: String - - """Greater than or equal to the specified value.""" - greaterThanOrEqualTo: String - - """Contains the specified string (case-sensitive).""" - includes: String - - """Does not contain the specified string (case-sensitive).""" - notIncludes: String - - """Contains the specified string (case-insensitive).""" - includesInsensitive: String + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} - """Does not contain the specified string (case-insensitive).""" - notIncludesInsensitive: String +"""All input for the \`deletePost\` mutation.""" +input DeletePostInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! +} - """Starts with the specified string (case-sensitive).""" - startsWith: String +"""The output of our delete \`Post\` mutation.""" +type DeletePostPayload { + """ + The exact same \`clientMutationId\` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String - """Does not start with the specified string (case-sensitive).""" - notStartsWith: String + """The \`Post\` that was deleted by this mutation.""" + post: Post - """Starts with the specified string (case-insensitive).""" - startsWithInsensitive: String + """An edge for our \`Post\`. May be used by Relay 1.""" + postEdge( + """The method to use when ordering \`Post\`.""" + orderBy: [PostOrderBy!]! = [PRIMARY_KEY_ASC] + ): PostEdge - """Does not start with the specified string (case-insensitive).""" - notStartsWithInsensitive: String + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query +} - """Ends with the specified string (case-sensitive).""" - endsWith: String +"""All input for the \`deletePostTag\` mutation.""" +input DeletePostTagInput { + """ + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. + """ + clientMutationId: String + id: UUID! +} - """Does not end with the specified string (case-sensitive).""" - notEndsWith: String +"""The output of our delete \`PostTag\` mutation.""" +type DeletePostTagPayload { + """ + The exact same \`clientMutationId\` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. + """ + clientMutationId: String - """Ends with the specified string (case-insensitive).""" - endsWithInsensitive: String + """The \`PostTag\` that was deleted by this mutation.""" + postTag: PostTag - """Does not end with the specified string (case-insensitive).""" - notEndsWithInsensitive: String + """An edge for our \`PostTag\`. May be used by Relay 1.""" + postTagEdge( + """The method to use when ordering \`PostTag\`.""" + orderBy: [PostTagOrderBy!]! = [PRIMARY_KEY_ASC] + ): PostTagEdge """ - Matches the specified pattern (case-sensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. + Our root query field type. Allows us to run any query from our mutation payload. """ - like: String + query: Query +} +"""All input for the \`deleteTag\` mutation.""" +input DeleteTagInput { """ - Does not match the specified pattern (case-sensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. """ - notLike: String + clientMutationId: String + id: UUID! +} +"""The output of our delete \`Tag\` mutation.""" +type DeleteTagPayload { """ - Matches the specified pattern (case-insensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. + The exact same \`clientMutationId\` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. """ - likeInsensitive: String + clientMutationId: String """ - Does not match the specified pattern (case-insensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. + Our root query field type. Allows us to run any query from our mutation payload. """ - notLikeInsensitive: String + query: Query - """Equal to the specified value (case-insensitive).""" - equalToInsensitive: String + """The \`Tag\` that was deleted by this mutation.""" + tag: Tag - """Not equal to the specified value (case-insensitive).""" - notEqualToInsensitive: String + """An edge for our \`Tag\`. May be used by Relay 1.""" + tagEdge( + """The method to use when ordering \`Tag\`.""" + orderBy: [TagOrderBy!]! = [PRIMARY_KEY_ASC] + ): TagEdge +} +"""All input for the \`deleteUser\` mutation.""" +input DeleteUserInput { """ - Not equal to the specified value, treating null like an ordinary value (case-insensitive). + An arbitrary string value with no semantic meaning. Will be included in the + payload verbatim. May be used to track mutations by the client. """ - distinctFromInsensitive: String + clientMutationId: String + id: UUID! +} +"""The output of our delete \`User\` mutation.""" +type DeleteUserPayload { """ - Equal to the specified value, treating null like an ordinary value (case-insensitive). + The exact same \`clientMutationId\` that was provided in the mutation input, + unchanged and unused. May be used by a client to track mutations. """ - notDistinctFromInsensitive: String - - """Included in the specified list (case-insensitive).""" - inInsensitive: [String!] - - """Not included in the specified list (case-insensitive).""" - notInInsensitive: [String!] - - """Less than the specified value (case-insensitive).""" - lessThanInsensitive: String + clientMutationId: String - """Less than or equal to the specified value (case-insensitive).""" - lessThanOrEqualToInsensitive: String + """ + Our root query field type. Allows us to run any query from our mutation payload. + """ + query: Query - """Greater than the specified value (case-insensitive).""" - greaterThanInsensitive: String + """The \`User\` that was deleted by this mutation.""" + user: User - """Greater than or equal to the specified value (case-insensitive).""" - greaterThanOrEqualToInsensitive: String + """An edge for our \`User\`. May be used by Relay 1.""" + userEdge( + """The method to use when ordering \`User\`.""" + orderBy: [UserOrderBy!]! = [PRIMARY_KEY_ASC] + ): UserEdge } """ -A filter to be used against Boolean fields. All fields are combined with a logical ‘and.’ +A filter to be used against Int fields. All fields are combined with a logical ‘and.’ """ -input BooleanFilter { - """ - Is null (if \`true\` is specified) or is not null (if \`false\` is specified). - """ - isNull: Boolean - - """Equal to the specified value.""" - equalTo: Boolean - - """Not equal to the specified value.""" - notEqualTo: Boolean - +input IntFilter { """ Not equal to the specified value, treating null like an ordinary value. """ - distinctFrom: Boolean - - """Equal to the specified value, treating null like an ordinary value.""" - notDistinctFrom: Boolean - - """Included in the specified list.""" - in: [Boolean!] - - """Not included in the specified list.""" - notIn: [Boolean!] - - """Less than the specified value.""" - lessThan: Boolean + distinctFrom: Int - """Less than or equal to the specified value.""" - lessThanOrEqualTo: Boolean + """Equal to the specified value.""" + equalTo: Int """Greater than the specified value.""" - greaterThan: Boolean + greaterThan: Int """Greater than or equal to the specified value.""" - greaterThanOrEqualTo: Boolean -} + greaterThanOrEqualTo: Int + + """Included in the specified list.""" + in: [Int!] -""" -A filter to be used against Datetime fields. All fields are combined with a logical ‘and.’ -""" -input DatetimeFilter { """ Is null (if \`true\` is specified) or is not null (if \`false\` is specified). """ isNull: Boolean - """Equal to the specified value.""" - equalTo: Datetime - - """Not equal to the specified value.""" - notEqualTo: Datetime + """Less than the specified value.""" + lessThan: Int - """ - Not equal to the specified value, treating null like an ordinary value. - """ - distinctFrom: Datetime + """Less than or equal to the specified value.""" + lessThanOrEqualTo: Int """Equal to the specified value, treating null like an ordinary value.""" - notDistinctFrom: Datetime + notDistinctFrom: Int - """Included in the specified list.""" - in: [Datetime!] + """Not equal to the specified value.""" + notEqualTo: Int """Not included in the specified list.""" - notIn: [Datetime!] - - """Less than the specified value.""" - lessThan: Datetime - - """Less than or equal to the specified value.""" - lessThanOrEqualTo: Datetime - - """Greater than the specified value.""" - greaterThan: Datetime - - """Greater than or equal to the specified value.""" - greaterThanOrEqualTo: Datetime + notIn: [Int!] } -""" -A filter to be used against Int fields. All fields are combined with a logical ‘and.’ -""" -input IntFilter { - """ - Is null (if \`true\` is specified) or is not null (if \`false\` is specified). - """ - isNull: Boolean - - """Equal to the specified value.""" - equalTo: Int +"""A belongs-to (forward FK) relation""" +type MetaBelongsToRelation { + fieldName: String + isUnique: Boolean! + keys: [MetaField!]! + references: MetaRefTable! + type: String +} - """Not equal to the specified value.""" - notEqualTo: Int +"""Table constraints""" +type MetaConstraints { + foreignKey: [MetaForeignKeyConstraint!]! + primaryKey: MetaPrimaryKeyConstraint + unique: [MetaUniqueConstraint!]! +} - """ - Not equal to the specified value, treating null like an ordinary value. - """ - distinctFrom: Int +"""Information about a PostgreSQL enum type""" +type MetaEnum { + """The PostgreSQL enum type name""" + name: String! - """Equal to the specified value, treating null like an ordinary value.""" - notDistinctFrom: Int + """Allowed values for this enum""" + values: [String!]! +} - """Included in the specified list.""" - in: [Int!] +"""Information about a table field/column""" +type MetaField { + description: String - """Not included in the specified list.""" - notIn: [Int!] + """Enum metadata if this field has an enum type""" + enumValues: MetaEnum + hasDefault: Boolean! + isForeignKey: Boolean! + isNotNull: Boolean! + isPrimaryKey: Boolean! + name: String! + type: MetaType! +} - """Less than the specified value.""" - lessThan: Int +"""Information about a foreign key constraint""" +type MetaForeignKeyConstraint { + fields: [MetaField!]! + name: String! + refFields: [MetaField!] + refTable: MetaRefTable + referencedFields: [String!]! + referencedTable: String! +} - """Less than or equal to the specified value.""" - lessThanOrEqualTo: Int +"""A has-one or has-many (reverse FK) relation""" +type MetaHasRelation { + fieldName: String + isUnique: Boolean! + keys: [MetaField!]! + referencedBy: MetaRefTable! + type: String +} - """Greater than the specified value.""" - greaterThan: Int +"""i18n metadata for a table with @i18n tag""" +type MetaI18n { + """Fields that are translatable""" + translatableFields: [MetaI18nField!]! - """Greater than or equal to the specified value.""" - greaterThanOrEqualTo: Int + """Name of the translation table""" + translationTable: String! } -""" -A filter to be used against \`User\` object types. All fields are combined with a logical ‘and.’ -""" -input UserFilter { - """Filter by the object’s \`id\` field.""" - id: UUIDFilter - - """Filter by the object’s \`email\` field.""" - email: StringFilter +"""A translatable field""" +type MetaI18nField { + """GraphQL field name""" + name: String! - """Filter by the object’s \`username\` field.""" - username: StringFilter + """PostgreSQL column type (text, citext)""" + type: String! +} - """Filter by the object’s \`displayName\` field.""" - displayName: StringFilter +"""Information about a database index""" +type MetaIndex { + columns: [String!]! + fields: [MetaField!] + isPrimary: Boolean! + isUnique: Boolean! + name: String! +} - """Filter by the object’s \`bio\` field.""" - bio: StringFilter +"""Table inflection names""" +type MetaInflection { + allRows: String! + conditionType: String! + connection: String! + createInputType: String! + createPayloadType: String! + deletePayloadType: String! + edge: String! + filterType: String + orderByType: String! + patchType: String + tableType: String! + updatePayloadType: String +} - """Filter by the object’s \`isActive\` field.""" - isActive: BooleanFilter +"""A many-to-many relation via junction table""" +type MetaManyToManyRelation { + fieldName: String + junctionLeftConstraint: MetaForeignKeyConstraint! + junctionLeftKeyAttributes: [MetaField!]! + junctionRightConstraint: MetaForeignKeyConstraint! + junctionRightKeyAttributes: [MetaField!]! + junctionTable: MetaRefTable! + leftKeyAttributes: [MetaField!]! + rightKeyAttributes: [MetaField!]! + rightTable: MetaRefTable! + type: String +} - """Filter by the object’s \`role\` field.""" - role: StringFilter +"""Information about a primary key constraint""" +type MetaPrimaryKeyConstraint { + fields: [MetaField!]! + name: String! +} - """Filter by the object’s \`createdAt\` field.""" - createdAt: DatetimeFilter +"""Table query/mutation names""" +type MetaQuery { + all: String! + create: String + delete: String + one: String + update: String +} - """Filter by the object’s \`updatedAt\` field.""" - updatedAt: DatetimeFilter +"""Realtime metadata for a table with @realtime tag""" +type MetaRealtime { + """The generated subscription field name (e.g. onPostChanged)""" + subscriptionFieldName: String! +} - """Checks for all expressions in this list.""" - and: [UserFilter!] +"""Reference to a related table""" +type MetaRefTable { + name: String! +} - """Checks for any expressions in this list.""" - or: [UserFilter!] +"""Table relations""" +type MetaRelations { + belongsTo: [MetaBelongsToRelation!]! + has: [MetaHasRelation!]! + hasMany: [MetaHasRelation!]! + hasOne: [MetaHasRelation!]! + manyToMany: [MetaManyToManyRelation!]! +} - """Negates the expression.""" - not: UserFilter +"""Root meta schema type""" +type MetaSchema { + tables: [MetaTable!]! +} - """Filter by the object’s \`authoredPosts\` relation.""" - authoredPosts: UserToManyPostFilter +"""Search metadata for a table""" +type MetaSearch { + """Active search algorithms on this table""" + algorithms: [String!]! - """\`authoredPosts\` exist.""" - authoredPostsExist: Boolean + """Searchable columns with their algorithm""" + columns: [MetaSearchColumn!]! - """Filter by the object’s \`authoredComments\` relation.""" - authoredComments: UserToManyCommentFilter + """Per-table search configuration""" + config: MetaSearchConfig - """\`authoredComments\` exist.""" - authoredCommentsExist: Boolean + """Whether unifiedSearch composite filter is available""" + hasUnifiedSearch: Boolean! } -""" -A filter to be used against many \`Post\` object types. All fields are combined with a logical ‘and.’ -""" -input UserToManyPostFilter { - """Filters to entities where at least one related entity matches.""" - some: PostFilter - - """Filters to entities where every related entity matches.""" - every: PostFilter +"""A searchable column with its algorithm""" +type MetaSearchColumn { + """Search algorithm: tsvector, bm25, trgm, or vector""" + algorithm: String! - """Filters to entities where no related entity matches.""" - none: PostFilter + """Column name (camelCase)""" + name: String! } -""" -A filter to be used against many \`Comment\` object types. All fields are combined with a logical ‘and.’ -""" -input UserToManyCommentFilter { - """Filters to entities where at least one related entity matches.""" - some: CommentFilter +"""Per-table search configuration from @searchConfig smart tag""" +type MetaSearchConfig { + """Exponential decay factor per day""" + boostRecencyDecay: Float - """Filters to entities where every related entity matches.""" - every: CommentFilter + """Field used for recency decay""" + boostRecencyField: String - """Filters to entities where no related entity matches.""" - none: CommentFilter + """Whether recency boosting is enabled""" + boostRecent: Boolean! + + """JSON-encoded per-adapter score weights""" + weights: String } -""" -A filter to be used against \`Comment\` object types. All fields are combined with a logical ‘and.’ -""" -input CommentFilter { - """Filter by the object’s \`id\` field.""" - id: UUIDFilter +"""Storage metadata for a table""" +type MetaStorage { + """Whether this table is a storage buckets table""" + isBucketsTable: Boolean! - """Filter by the object’s \`postId\` field.""" - postId: UUIDFilter + """Whether this table is a storage files table""" + isFilesTable: Boolean! +} + +"""Information about a database table""" +type MetaTable { + constraints: MetaConstraints! + fields: [MetaField!]! + foreignKeyConstraints: [MetaForeignKeyConstraint!]! + + """i18n metadata (null if no @i18n tag)""" + i18n: MetaI18n + indexes: [MetaIndex!]! + inflection: MetaInflection! + name: String! + primaryKeyConstraints: [MetaPrimaryKeyConstraint!]! + query: MetaQuery! + + """Realtime metadata (null if no @realtime tag)""" + realtime: MetaRealtime + relations: MetaRelations! + schemaName: String! + + """Search metadata (null if no search configured)""" + search: MetaSearch + + """Storage metadata (null if not a storage table)""" + storage: MetaStorage + uniqueConstraints: [MetaUniqueConstraint!]! +} + +"""Information about a PostgreSQL type""" +type MetaType { + gqlType: String! + hasDefault: Boolean + isArray: Boolean! + isNotNull: Boolean + pgType: String! + subtype: String +} + +"""Information about a unique constraint""" +type MetaUniqueConstraint { + fields: [MetaField!]! + name: String! +} + +""" +The root mutation type which contains root level fields which mutate data. +""" +type Mutation { + """Creates a single \`Comment\`.""" + createComment( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateCommentInput! + ): CreateCommentPayload + + """Creates a single \`Post\`.""" + createPost( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreatePostInput! + ): CreatePostPayload + + """Creates a single \`PostTag\`.""" + createPostTag( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreatePostTagInput! + ): CreatePostTagPayload + + """Creates a single \`Tag\`.""" + createTag( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateTagInput! + ): CreateTagPayload + + """Creates a single \`User\`.""" + createUser( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: CreateUserInput! + ): CreateUserPayload + + """Deletes a single \`Comment\` using a unique key.""" + deleteComment( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteCommentInput! + ): DeleteCommentPayload + + """Deletes a single \`Post\` using a unique key.""" + deletePost( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeletePostInput! + ): DeletePostPayload + + """Deletes a single \`PostTag\` using a unique key.""" + deletePostTag( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeletePostTagInput! + ): DeletePostTagPayload + + """Deletes a single \`Tag\` using a unique key.""" + deleteTag( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteTagInput! + ): DeleteTagPayload + + """Deletes a single \`User\` using a unique key.""" + deleteUser( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: DeleteUserInput! + ): DeleteUserPayload + + """ + Provision an S3 bucket for a logical bucket in the database. + Reads the bucket config via RLS, then creates and configures + the S3 bucket with the appropriate privacy policies, CORS rules, + and lifecycle settings. + """ + provisionBucket( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: ProvisionBucketInput! + ): ProvisionBucketPayload + + """Updates a single \`Comment\` using a unique key and a patch.""" + updateComment( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateCommentInput! + ): UpdateCommentPayload + + """Updates a single \`Post\` using a unique key and a patch.""" + updatePost( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdatePostInput! + ): UpdatePostPayload + + """Updates a single \`PostTag\` using a unique key and a patch.""" + updatePostTag( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdatePostTagInput! + ): UpdatePostTagPayload + + """Updates a single \`Tag\` using a unique key and a patch.""" + updateTag( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateTagInput! + ): UpdateTagPayload + + """Updates a single \`User\` using a unique key and a patch.""" + updateUser( + """ + The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + """ + input: UpdateUserInput! + ): UpdateUserPayload +} + +"""Information about pagination in a connection.""" +type PageInfo { + """When paginating forwards, the cursor to continue.""" + endCursor: Cursor + + """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: Cursor +} + +type Post { + """Reads a single \`User\` that is related to this \`Post\`.""" + author: User + authorId: UUID! + + """Reads and enables pagination through a set of \`Comment\`.""" + comments( + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Only read the first \`n\` values of the set.""" + first: Int + + """Only read the last \`n\` values of the set.""" + last: Int + + """ + Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor + based pagination. May not be used with \`last\`. + """ + offset: Int + + """The method to use when ordering \`Comment\`.""" + orderBy: [CommentOrderBy!] = [PRIMARY_KEY_ASC] + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: CommentFilter + ): CommentConnection! + content: String + createdAt: Datetime + excerpt: String + id: UUID! + isPublished: Boolean + + """Reads and enables pagination through a set of \`PostTag\`.""" + postTags( + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Only read the first \`n\` values of the set.""" + first: Int + + """Only read the last \`n\` values of the set.""" + last: Int + + """ + Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor + based pagination. May not be used with \`last\`. + """ + offset: Int + + """The method to use when ordering \`PostTag\`.""" + orderBy: [PostTagOrderBy!] = [PRIMARY_KEY_ASC] + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: PostTagFilter + ): PostTagConnection! + publishedAt: Datetime + slug: String! + + """Reads and enables pagination through a set of \`Tag\`.""" + tags( + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Only read the first \`n\` values of the set.""" + first: Int + + """Only read the last \`n\` values of the set.""" + last: Int + + """ + Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor + based pagination. May not be used with \`last\`. + """ + offset: Int + + """The method to use when ordering \`Tag\`.""" + orderBy: [TagOrderBy!] = [PRIMARY_KEY_ASC] + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: TagFilter + ): PostTagsManyToManyConnection! + title: String! + updatedAt: Datetime + viewCount: Int +} + +"""A connection to a list of \`Post\` values.""" +type PostConnection { + """ + A list of edges which contains the \`Post\` and cursor to aid in pagination. + """ + edges: [PostEdge]! + + """A list of \`Post\` objects.""" + nodes: [Post]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """The count of *all* \`Post\` you could get from the connection.""" + totalCount: Int! +} + +"""A \`Post\` edge in the connection.""" +type PostEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The \`Post\` at the end of the edge.""" + node: Post +} + +""" +A filter to be used against \`Post\` object types. All fields are combined with a logical ‘and.’ +""" +input PostFilter { + """Checks for all expressions in this list.""" + and: [PostFilter!] + + """Filter by the object’s \`author\` relation.""" + author: UserFilter """Filter by the object’s \`authorId\` field.""" authorId: UUIDFilter - """Filter by the object’s \`parentId\` field.""" - parentId: UUIDFilter + """Filter by the object’s \`comments\` relation.""" + comments: PostToManyCommentFilter + + """\`comments\` exist.""" + commentsExist: Boolean """Filter by the object’s \`content\` field.""" content: StringFilter - """Filter by the object’s \`isApproved\` field.""" - isApproved: BooleanFilter - - """Filter by the object’s \`likesCount\` field.""" - likesCount: IntFilter - """Filter by the object’s \`createdAt\` field.""" createdAt: DatetimeFilter - """Filter by the object’s \`updatedAt\` field.""" - updatedAt: DatetimeFilter + """Filter by the object’s \`excerpt\` field.""" + excerpt: StringFilter - """Checks for all expressions in this list.""" - and: [CommentFilter!] + """Filter by the object’s \`id\` field.""" + id: UUIDFilter - """Checks for any expressions in this list.""" - or: [CommentFilter!] + """Filter by the object’s \`isPublished\` field.""" + isPublished: BooleanFilter """Negates the expression.""" - not: CommentFilter - - """Filter by the object’s \`author\` relation.""" - author: UserFilter + not: PostFilter - """Filter by the object’s \`parent\` relation.""" - parent: CommentFilter + """Checks for any expressions in this list.""" + or: [PostFilter!] - """A related \`parent\` exists.""" - parentExists: Boolean + """Filter by the object’s \`postTags\` relation.""" + postTags: PostToManyPostTagFilter - """Filter by the object’s \`post\` relation.""" - post: PostFilter + """\`postTags\` exist.""" + postTagsExist: Boolean - """Filter by the object’s \`childComments\` relation.""" - childComments: CommentToManyCommentFilter + """Filter by the object’s \`publishedAt\` field.""" + publishedAt: DatetimeFilter - """\`childComments\` exist.""" - childCommentsExist: Boolean -} + """Filter by the object’s \`slug\` field.""" + slug: StringFilter -""" -A filter to be used against many \`Comment\` object types. All fields are combined with a logical ‘and.’ -""" -input CommentToManyCommentFilter { - """Filters to entities where at least one related entity matches.""" - some: CommentFilter + """Filter by the object’s \`title\` field.""" + title: StringFilter - """Filters to entities where every related entity matches.""" - every: CommentFilter + """Filter by the object’s \`updatedAt\` field.""" + updatedAt: DatetimeFilter - """Filters to entities where no related entity matches.""" - none: CommentFilter + """Filter by the object’s \`viewCount\` field.""" + viewCount: IntFilter } -""" -A filter to be used against many \`PostTag\` object types. All fields are combined with a logical ‘and.’ -""" -input PostToManyPostTagFilter { - """Filters to entities where at least one related entity matches.""" - some: PostTagFilter +"""An input for mutations affecting \`Post\`""" +input PostInput { + authorId: UUID! + content: String + createdAt: Datetime + excerpt: String + id: UUID + isPublished: Boolean + publishedAt: Datetime + slug: String! + title: String! + updatedAt: Datetime + viewCount: Int +} - """Filters to entities where every related entity matches.""" - every: PostTagFilter +"""Methods to use when ordering \`Post\`.""" +enum PostOrderBy { + AUTHOR_ID_ASC + AUTHOR_ID_DESC + CONTENT_ASC + CONTENT_DESC + CREATED_AT_ASC + CREATED_AT_DESC + EXCERPT_ASC + EXCERPT_DESC + ID_ASC + ID_DESC + IS_PUBLISHED_ASC + IS_PUBLISHED_DESC + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + PUBLISHED_AT_ASC + PUBLISHED_AT_DESC + SLUG_ASC + SLUG_DESC + TITLE_ASC + TITLE_DESC + UPDATED_AT_ASC + UPDATED_AT_DESC + VIEW_COUNT_ASC + VIEW_COUNT_DESC +} - """Filters to entities where no related entity matches.""" - none: PostTagFilter +"""Represents an update to a \`Post\`. Fields that are set will be updated.""" +input PostPatch { + authorId: UUID + content: String + createdAt: Datetime + excerpt: String + id: UUID + isPublished: Boolean + publishedAt: Datetime + slug: String + title: String + updatedAt: Datetime + viewCount: Int } -""" -A filter to be used against \`PostTag\` object types. All fields are combined with a logical ‘and.’ -""" -input PostTagFilter { - """Filter by the object’s \`id\` field.""" - id: UUIDFilter +type PostTag { + createdAt: Datetime + id: UUID! - """Filter by the object’s \`postId\` field.""" - postId: UUIDFilter + """Reads a single \`Post\` that is related to this \`PostTag\`.""" + post: Post + postId: UUID! - """Filter by the object’s \`tagId\` field.""" - tagId: UUIDFilter + """Reads a single \`Tag\` that is related to this \`PostTag\`.""" + tag: Tag + tagId: UUID! +} - """Filter by the object’s \`createdAt\` field.""" - createdAt: DatetimeFilter +"""A connection to a list of \`PostTag\` values.""" +type PostTagConnection { + """ + A list of edges which contains the \`PostTag\` and cursor to aid in pagination. + """ + edges: [PostTagEdge]! - """Checks for all expressions in this list.""" - and: [PostTagFilter!] + """A list of \`PostTag\` objects.""" + nodes: [PostTag]! - """Checks for any expressions in this list.""" - or: [PostTagFilter!] + """Information to aid in pagination.""" + pageInfo: PageInfo! - """Negates the expression.""" - not: PostTagFilter + """The count of *all* \`PostTag\` you could get from the connection.""" + totalCount: Int! +} - """Filter by the object’s \`post\` relation.""" - post: PostFilter +"""A \`PostTag\` edge in the connection.""" +type PostTagEdge { + """A cursor for use in pagination.""" + cursor: Cursor - """Filter by the object’s \`tag\` relation.""" - tag: TagFilter + """The \`PostTag\` at the end of the edge.""" + node: PostTag } """ -A filter to be used against \`Tag\` object types. All fields are combined with a logical ‘and.’ +A filter to be used against \`PostTag\` object types. All fields are combined with a logical ‘and.’ """ -input TagFilter { - """Filter by the object’s \`id\` field.""" - id: UUIDFilter - - """Filter by the object’s \`name\` field.""" - name: StringFilter - - """Filter by the object’s \`slug\` field.""" - slug: StringFilter - - """Filter by the object’s \`description\` field.""" - description: StringFilter - - """Filter by the object’s \`color\` field.""" - color: StringFilter +input PostTagFilter { + """Checks for all expressions in this list.""" + and: [PostTagFilter!] """Filter by the object’s \`createdAt\` field.""" createdAt: DatetimeFilter - """Checks for all expressions in this list.""" - and: [TagFilter!] - - """Checks for any expressions in this list.""" - or: [TagFilter!] + """Filter by the object’s \`id\` field.""" + id: UUIDFilter """Negates the expression.""" - not: TagFilter - - """Filter by the object’s \`postTags\` relation.""" - postTags: TagToManyPostTagFilter - - """\`postTags\` exist.""" - postTagsExist: Boolean -} - -""" -A filter to be used against many \`PostTag\` object types. All fields are combined with a logical ‘and.’ -""" -input TagToManyPostTagFilter { - """Filters to entities where at least one related entity matches.""" - some: PostTagFilter + not: PostTagFilter - """Filters to entities where every related entity matches.""" - every: PostTagFilter + """Checks for any expressions in this list.""" + or: [PostTagFilter!] - """Filters to entities where no related entity matches.""" - none: PostTagFilter -} + """Filter by the object’s \`post\` relation.""" + post: PostFilter -""" -A filter to be used against many \`Comment\` object types. All fields are combined with a logical ‘and.’ -""" -input PostToManyCommentFilter { - """Filters to entities where at least one related entity matches.""" - some: CommentFilter + """Filter by the object’s \`postId\` field.""" + postId: UUIDFilter - """Filters to entities where every related entity matches.""" - every: CommentFilter + """Filter by the object’s \`tag\` relation.""" + tag: TagFilter - """Filters to entities where no related entity matches.""" - none: CommentFilter + """Filter by the object’s \`tagId\` field.""" + tagId: UUIDFilter } -"""Methods to use when ordering \`Post\`.""" -enum PostOrderBy { - NATURAL - PRIMARY_KEY_ASC - PRIMARY_KEY_DESC - ID_ASC - ID_DESC - AUTHOR_ID_ASC - AUTHOR_ID_DESC - TITLE_ASC - TITLE_DESC - SLUG_ASC - SLUG_DESC - CONTENT_ASC - CONTENT_DESC - EXCERPT_ASC - EXCERPT_DESC - IS_PUBLISHED_ASC - IS_PUBLISHED_DESC - PUBLISHED_AT_ASC - PUBLISHED_AT_DESC - VIEW_COUNT_ASC - VIEW_COUNT_DESC - CREATED_AT_ASC - CREATED_AT_DESC - UPDATED_AT_ASC - UPDATED_AT_DESC +"""An input for mutations affecting \`PostTag\`""" +input PostTagInput { + createdAt: Datetime + id: UUID + postId: UUID! + tagId: UUID! } """Methods to use when ordering \`PostTag\`.""" enum PostTagOrderBy { - NATURAL - PRIMARY_KEY_ASC - PRIMARY_KEY_DESC + CREATED_AT_ASC + CREATED_AT_DESC ID_ASC ID_DESC + NATURAL POST_ID_ASC POST_ID_DESC + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC TAG_ID_ASC TAG_ID_DESC - CREATED_AT_ASC - CREATED_AT_DESC } -"""A \`Tag\` edge in the connection, with data from \`PostTag\`.""" -type PostTagsManyToManyEdge { - """A cursor for use in pagination.""" - cursor: Cursor - - """The \`Tag\` at the end of the edge.""" - node: Tag - id: UUID! +""" +Represents an update to a \`PostTag\`. Fields that are set will be updated. +""" +input PostTagPatch { createdAt: Datetime + id: UUID + postId: UUID + tagId: UUID } -"""Methods to use when ordering \`Tag\`.""" -enum TagOrderBy { - NATURAL - PRIMARY_KEY_ASC - PRIMARY_KEY_DESC - ID_ASC - ID_DESC - NAME_ASC - NAME_DESC - SLUG_ASC - SLUG_DESC - DESCRIPTION_ASC - DESCRIPTION_DESC - COLOR_ASC - COLOR_DESC - CREATED_AT_ASC - CREATED_AT_DESC -} - -type User { - id: UUID! - email: String! - username: String! - displayName: String - bio: String - isActive: Boolean - role: String - createdAt: Datetime - updatedAt: Datetime - - """Reads and enables pagination through a set of \`Post\`.""" - authoredPosts( - """Only read the first \`n\` values of the set.""" - first: Int - - """Only read the last \`n\` values of the set.""" - last: Int +"""A connection to a list of \`Tag\` values, with data from \`PostTag\`.""" +type PostTagsManyToManyConnection { + """ + A list of edges which contains the \`Tag\`, info from the \`PostTag\`, and the cursor to aid in pagination. + """ + edges: [PostTagsManyToManyEdge!]! - """ - Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor - based pagination. May not be used with \`last\`. - """ - offset: Int + """A list of \`Tag\` objects.""" + nodes: [Tag]! - """Read all values in the set before (above) this cursor.""" - before: Cursor + """Information to aid in pagination.""" + pageInfo: PageInfo! - """Read all values in the set after (below) this cursor.""" - after: Cursor + """The count of *all* \`Tag\` you could get from the connection.""" + totalCount: Int! +} - """ - A filter to be used in determining which values should be returned by the collection. - """ - where: PostFilter +"""A \`Tag\` edge in the connection, with data from \`PostTag\`.""" +type PostTagsManyToManyEdge { + createdAt: Datetime - """The method to use when ordering \`Post\`.""" - orderBy: [PostOrderBy!] = [PRIMARY_KEY_ASC] - ): PostConnection! + """A cursor for use in pagination.""" + cursor: Cursor + id: UUID! - """Reads and enables pagination through a set of \`Comment\`.""" - authoredComments( - """Only read the first \`n\` values of the set.""" - first: Int + """The \`Tag\` at the end of the edge.""" + node: Tag +} - """Only read the last \`n\` values of the set.""" - last: Int +""" +A filter to be used against many \`Comment\` object types. All fields are combined with a logical ‘and.’ +""" +input PostToManyCommentFilter { + """Filters to entities where every related entity matches.""" + every: CommentFilter - """ - Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor - based pagination. May not be used with \`last\`. - """ - offset: Int + """Filters to entities where no related entity matches.""" + none: CommentFilter - """Read all values in the set before (above) this cursor.""" - before: Cursor + """Filters to entities where at least one related entity matches.""" + some: CommentFilter +} - """Read all values in the set after (below) this cursor.""" - after: Cursor +""" +A filter to be used against many \`PostTag\` object types. All fields are combined with a logical ‘and.’ +""" +input PostToManyPostTagFilter { + """Filters to entities where every related entity matches.""" + every: PostTagFilter - """ - A filter to be used in determining which values should be returned by the collection. - """ - where: CommentFilter + """Filters to entities where no related entity matches.""" + none: PostTagFilter - """The method to use when ordering \`Comment\`.""" - orderBy: [CommentOrderBy!] = [PRIMARY_KEY_ASC] - ): CommentConnection! + """Filters to entities where at least one related entity matches.""" + some: PostTagFilter } -"""A connection to a list of \`Post\` values.""" -type PostConnection { - """A list of \`Post\` objects.""" - nodes: [Post]! +input ProvisionBucketInput { + """The logical bucket key (e.g., "public", "private")""" + bucketKey: String! """ - A list of edges which contains the \`Post\` and cursor to aid in pagination. + Owner entity ID for entity-scoped bucket provisioning. + Omit for app-level (database-wide) storage. """ - edges: [PostEdge]! - - """Information to aid in pagination.""" - pageInfo: PageInfo! - - """The count of *all* \`Post\` you could get from the connection.""" - totalCount: Int! + ownerId: UUID } -"""A \`Post\` edge in the connection.""" -type PostEdge { - """A cursor for use in pagination.""" - cursor: Cursor +type ProvisionBucketPayload { + """The access type applied""" + accessType: String! - """The \`Post\` at the end of the edge.""" - node: Post -} + """The S3 bucket name that was provisioned""" + bucketName: String! -"""A connection to a list of \`Comment\` values.""" -type CommentConnection { - """A list of \`Comment\` objects.""" - nodes: [Comment]! + """The S3 endpoint (null for AWS S3 default)""" + endpoint: String - """ - A list of edges which contains the \`Comment\` and cursor to aid in pagination. - """ - edges: [CommentEdge]! + """Error message if provisioning failed""" + error: String - """Information to aid in pagination.""" - pageInfo: PageInfo! + """The storage provider used""" + provider: String! - """The count of *all* \`Comment\` you could get from the connection.""" - totalCount: Int! + """Whether provisioning succeeded""" + success: Boolean! } -type Comment { - id: UUID! - postId: UUID! - authorId: UUID! - parentId: UUID - content: String! - isApproved: Boolean - likesCount: Int - createdAt: Datetime - updatedAt: Datetime - - """Reads a single \`User\` that is related to this \`Comment\`.""" - author: User - - """Reads a single \`Comment\` that is related to this \`Comment\`.""" - parent: Comment - - """Reads a single \`Post\` that is related to this \`Comment\`.""" - post: Post +"""The root query type which gives access points into the data universe.""" +type Query { + """ + Metadata about the database schema, including tables, fields, indexes, and constraints. Useful for code generation tools. + """ + _meta: MetaSchema """Reads and enables pagination through a set of \`Comment\`.""" - childComments( + comments( + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """Read all values in the set before (above) this cursor.""" + before: Cursor + """Only read the first \`n\` values of the set.""" first: Int @@ -1281,833 +1548,564 @@ type Comment { """ offset: Int - """Read all values in the set before (above) this cursor.""" - before: Cursor - - """Read all values in the set after (below) this cursor.""" - after: Cursor + """The method to use when ordering \`Comment\`.""" + orderBy: [CommentOrderBy!] = [PRIMARY_KEY_ASC] """ A filter to be used in determining which values should be returned by the collection. """ where: CommentFilter + ): CommentConnection - """The method to use when ordering \`Comment\`.""" - orderBy: [CommentOrderBy!] = [PRIMARY_KEY_ASC] - ): CommentConnection! -} + """Reads and enables pagination through a set of \`PostTag\`.""" + postTags( + """Read all values in the set after (below) this cursor.""" + after: Cursor -"""Methods to use when ordering \`Comment\`.""" -enum CommentOrderBy { - NATURAL - PRIMARY_KEY_ASC - PRIMARY_KEY_DESC - ID_ASC - ID_DESC - POST_ID_ASC - POST_ID_DESC - AUTHOR_ID_ASC - AUTHOR_ID_DESC - PARENT_ID_ASC - PARENT_ID_DESC - CONTENT_ASC - CONTENT_DESC - IS_APPROVED_ASC - IS_APPROVED_DESC - LIKES_COUNT_ASC - LIKES_COUNT_DESC - CREATED_AT_ASC - CREATED_AT_DESC - UPDATED_AT_ASC - UPDATED_AT_DESC -} + """Read all values in the set before (above) this cursor.""" + before: Cursor -"""A \`Comment\` edge in the connection.""" -type CommentEdge { - """A cursor for use in pagination.""" - cursor: Cursor + """Only read the first \`n\` values of the set.""" + first: Int - """The \`Comment\` at the end of the edge.""" - node: Comment -} + """Only read the last \`n\` values of the set.""" + last: Int -"""A \`PostTag\` edge in the connection.""" -type PostTagEdge { - """A cursor for use in pagination.""" - cursor: Cursor + """ + Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor + based pagination. May not be used with \`last\`. + """ + offset: Int - """The \`PostTag\` at the end of the edge.""" - node: PostTag -} + """The method to use when ordering \`PostTag\`.""" + orderBy: [PostTagOrderBy!] = [PRIMARY_KEY_ASC] -"""A connection to a list of \`Tag\` values.""" -type TagConnection { - """A list of \`Tag\` objects.""" - nodes: [Tag]! + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: PostTagFilter + ): PostTagConnection - """ - A list of edges which contains the \`Tag\` and cursor to aid in pagination. - """ - edges: [TagEdge]! + """Reads and enables pagination through a set of \`Post\`.""" + posts( + """Read all values in the set after (below) this cursor.""" + after: Cursor - """Information to aid in pagination.""" - pageInfo: PageInfo! + """Read all values in the set before (above) this cursor.""" + before: Cursor - """The count of *all* \`Tag\` you could get from the connection.""" - totalCount: Int! -} + """Only read the first \`n\` values of the set.""" + first: Int -"""A \`Tag\` edge in the connection.""" -type TagEdge { - """A cursor for use in pagination.""" - cursor: Cursor + """Only read the last \`n\` values of the set.""" + last: Int - """The \`Tag\` at the end of the edge.""" - node: Tag -} + """ + Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor + based pagination. May not be used with \`last\`. + """ + offset: Int -"""A connection to a list of \`User\` values.""" -type UserConnection { - """A list of \`User\` objects.""" - nodes: [User]! + """The method to use when ordering \`Post\`.""" + orderBy: [PostOrderBy!] = [PRIMARY_KEY_ASC] - """ - A list of edges which contains the \`User\` and cursor to aid in pagination. - """ - edges: [UserEdge]! + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: PostFilter + ): PostConnection - """Information to aid in pagination.""" - pageInfo: PageInfo! + """Reads and enables pagination through a set of \`Tag\`.""" + tags( + """Read all values in the set after (below) this cursor.""" + after: Cursor - """The count of *all* \`User\` you could get from the connection.""" - totalCount: Int! -} + """Read all values in the set before (above) this cursor.""" + before: Cursor -"""A \`User\` edge in the connection.""" -type UserEdge { - """A cursor for use in pagination.""" - cursor: Cursor + """Only read the first \`n\` values of the set.""" + first: Int - """The \`User\` at the end of the edge.""" - node: User -} + """Only read the last \`n\` values of the set.""" + last: Int -"""Methods to use when ordering \`User\`.""" -enum UserOrderBy { - NATURAL - PRIMARY_KEY_ASC - PRIMARY_KEY_DESC - ID_ASC - ID_DESC - EMAIL_ASC - EMAIL_DESC - USERNAME_ASC - USERNAME_DESC - DISPLAY_NAME_ASC - DISPLAY_NAME_DESC - BIO_ASC - BIO_DESC - IS_ACTIVE_ASC - IS_ACTIVE_DESC - ROLE_ASC - ROLE_DESC - CREATED_AT_ASC - CREATED_AT_DESC - UPDATED_AT_ASC - UPDATED_AT_DESC -} + """ + Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor + based pagination. May not be used with \`last\`. + """ + offset: Int -"""Root meta schema type""" -type MetaSchema { - tables: [MetaTable!]! -} + """The method to use when ordering \`Tag\`.""" + orderBy: [TagOrderBy!] = [PRIMARY_KEY_ASC] -"""Information about a database table""" -type MetaTable { - name: String! - schemaName: String! - fields: [MetaField!]! - indexes: [MetaIndex!]! - constraints: MetaConstraints! - foreignKeyConstraints: [MetaForeignKeyConstraint!]! - primaryKeyConstraints: [MetaPrimaryKeyConstraint!]! - uniqueConstraints: [MetaUniqueConstraint!]! - relations: MetaRelations! - inflection: MetaInflection! - query: MetaQuery! + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: TagFilter + ): TagConnection - """Storage metadata (null if not a storage table)""" - storage: MetaStorage + """Reads and enables pagination through a set of \`User\`.""" + users( + """Read all values in the set after (below) this cursor.""" + after: Cursor - """Search metadata (null if no search configured)""" - search: MetaSearch + """Read all values in the set before (above) this cursor.""" + before: Cursor - """i18n metadata (null if no @i18n tag)""" - i18n: MetaI18n + """Only read the first \`n\` values of the set.""" + first: Int - """Realtime metadata (null if no @realtime tag)""" - realtime: MetaRealtime + """Only read the last \`n\` values of the set.""" + last: Int + + """ + Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor + based pagination. May not be used with \`last\`. + """ + offset: Int + + """The method to use when ordering \`User\`.""" + orderBy: [UserOrderBy!] = [PRIMARY_KEY_ASC] + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: UserFilter + ): UserConnection } -"""Information about a table field/column""" -type MetaField { - name: String! - type: MetaType! - isNotNull: Boolean! - hasDefault: Boolean! - isPrimaryKey: Boolean! - isForeignKey: Boolean! - description: String +""" +A filter to be used against String fields. All fields are combined with a logical ‘and.’ +""" +input StringFilter { + """ + Not equal to the specified value, treating null like an ordinary value. + """ + distinctFrom: String + + """ + Not equal to the specified value, treating null like an ordinary value (case-insensitive). + """ + distinctFromInsensitive: String - """Enum metadata if this field has an enum type""" - enumValues: MetaEnum -} + """Ends with the specified string (case-sensitive).""" + endsWith: String -"""Information about a PostgreSQL type""" -type MetaType { - pgType: String! - gqlType: String! - isArray: Boolean! - isNotNull: Boolean - hasDefault: Boolean - subtype: String -} + """Ends with the specified string (case-insensitive).""" + endsWithInsensitive: String -"""Information about a PostgreSQL enum type""" -type MetaEnum { - """The PostgreSQL enum type name""" - name: String! + """Equal to the specified value.""" + equalTo: String - """Allowed values for this enum""" - values: [String!]! -} + """Equal to the specified value (case-insensitive).""" + equalToInsensitive: String -"""Information about a database index""" -type MetaIndex { - name: String! - isUnique: Boolean! - isPrimary: Boolean! - columns: [String!]! - fields: [MetaField!] -} + """Greater than the specified value.""" + greaterThan: String -"""Table constraints""" -type MetaConstraints { - primaryKey: MetaPrimaryKeyConstraint - unique: [MetaUniqueConstraint!]! - foreignKey: [MetaForeignKeyConstraint!]! -} + """Greater than the specified value (case-insensitive).""" + greaterThanInsensitive: String -"""Information about a primary key constraint""" -type MetaPrimaryKeyConstraint { - name: String! - fields: [MetaField!]! -} + """Greater than or equal to the specified value.""" + greaterThanOrEqualTo: String -"""Information about a unique constraint""" -type MetaUniqueConstraint { - name: String! - fields: [MetaField!]! -} + """Greater than or equal to the specified value (case-insensitive).""" + greaterThanOrEqualToInsensitive: String -"""Information about a foreign key constraint""" -type MetaForeignKeyConstraint { - name: String! - fields: [MetaField!]! - referencedTable: String! - referencedFields: [String!]! - refFields: [MetaField!] - refTable: MetaRefTable -} + """Included in the specified list.""" + in: [String!] -"""Reference to a related table""" -type MetaRefTable { - name: String! -} + """Included in the specified list (case-insensitive).""" + inInsensitive: [String!] -"""Table relations""" -type MetaRelations { - belongsTo: [MetaBelongsToRelation!]! - has: [MetaHasRelation!]! - hasOne: [MetaHasRelation!]! - hasMany: [MetaHasRelation!]! - manyToMany: [MetaManyToManyRelation!]! -} + """Contains the specified string (case-sensitive).""" + includes: String -"""A belongs-to (forward FK) relation""" -type MetaBelongsToRelation { - fieldName: String - isUnique: Boolean! - type: String - keys: [MetaField!]! - references: MetaRefTable! -} + """Contains the specified string (case-insensitive).""" + includesInsensitive: String -"""A has-one or has-many (reverse FK) relation""" -type MetaHasRelation { - fieldName: String - isUnique: Boolean! - type: String - keys: [MetaField!]! - referencedBy: MetaRefTable! -} + """ + Is null (if \`true\` is specified) or is not null (if \`false\` is specified). + """ + isNull: Boolean -"""A many-to-many relation via junction table""" -type MetaManyToManyRelation { - fieldName: String - type: String - junctionTable: MetaRefTable! - junctionLeftConstraint: MetaForeignKeyConstraint! - junctionLeftKeyAttributes: [MetaField!]! - junctionRightConstraint: MetaForeignKeyConstraint! - junctionRightKeyAttributes: [MetaField!]! - leftKeyAttributes: [MetaField!]! - rightKeyAttributes: [MetaField!]! - rightTable: MetaRefTable! -} + """Less than the specified value.""" + lessThan: String -"""Table inflection names""" -type MetaInflection { - tableType: String! - allRows: String! - connection: String! - edge: String! - filterType: String - orderByType: String! - conditionType: String! - patchType: String - createInputType: String! - createPayloadType: String! - updatePayloadType: String - deletePayloadType: String! -} + """Less than the specified value (case-insensitive).""" + lessThanInsensitive: String -"""Table query/mutation names""" -type MetaQuery { - all: String! - one: String - create: String - update: String - delete: String -} + """Less than or equal to the specified value.""" + lessThanOrEqualTo: String -"""Storage metadata for a table""" -type MetaStorage { - """Whether this table is a storage files table""" - isFilesTable: Boolean! + """Less than or equal to the specified value (case-insensitive).""" + lessThanOrEqualToInsensitive: String - """Whether this table is a storage buckets table""" - isBucketsTable: Boolean! -} + """ + Matches the specified pattern (case-sensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. + """ + like: String -"""Search metadata for a table""" -type MetaSearch { - """Active search algorithms on this table""" - algorithms: [String!]! + """ + Matches the specified pattern (case-insensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. + """ + likeInsensitive: String - """Searchable columns with their algorithm""" - columns: [MetaSearchColumn!]! + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: String - """Whether unifiedSearch composite filter is available""" - hasUnifiedSearch: Boolean! + """ + Equal to the specified value, treating null like an ordinary value (case-insensitive). + """ + notDistinctFromInsensitive: String - """Per-table search configuration""" - config: MetaSearchConfig -} + """Does not end with the specified string (case-sensitive).""" + notEndsWith: String -"""A searchable column with its algorithm""" -type MetaSearchColumn { - """Column name (camelCase)""" - name: String! + """Does not end with the specified string (case-insensitive).""" + notEndsWithInsensitive: String - """Search algorithm: tsvector, bm25, trgm, or vector""" - algorithm: String! -} + """Not equal to the specified value.""" + notEqualTo: String -"""Per-table search configuration from @searchConfig smart tag""" -type MetaSearchConfig { - """JSON-encoded per-adapter score weights""" - weights: String + """Not equal to the specified value (case-insensitive).""" + notEqualToInsensitive: String - """Whether recency boosting is enabled""" - boostRecent: Boolean! + """Not included in the specified list.""" + notIn: [String!] - """Field used for recency decay""" - boostRecencyField: String + """Not included in the specified list (case-insensitive).""" + notInInsensitive: [String!] - """Exponential decay factor per day""" - boostRecencyDecay: Float -} + """Does not contain the specified string (case-sensitive).""" + notIncludes: String -"""i18n metadata for a table with @i18n tag""" -type MetaI18n { - """Name of the translation table""" - translationTable: String! + """Does not contain the specified string (case-insensitive).""" + notIncludesInsensitive: String - """Fields that are translatable""" - translatableFields: [MetaI18nField!]! -} + """ + Does not match the specified pattern (case-sensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. + """ + notLike: String -"""A translatable field""" -type MetaI18nField { - """GraphQL field name""" - name: String! + """ + Does not match the specified pattern (case-insensitive). An underscore (_) matches any single character; a percent sign (%) matches any sequence of zero or more characters. + """ + notLikeInsensitive: String - """PostgreSQL column type (text, citext)""" - type: String! -} + """Does not start with the specified string (case-sensitive).""" + notStartsWith: String -"""Realtime metadata for a table with @realtime tag""" -type MetaRealtime { - """The generated subscription field name (e.g. onPostChanged)""" - subscriptionFieldName: String! -} + """Does not start with the specified string (case-insensitive).""" + notStartsWithInsensitive: String + + """Starts with the specified string (case-sensitive).""" + startsWith: String -""" -The root mutation type which contains root level fields which mutate data. -""" -type Mutation { - """Creates a single \`PostTag\`.""" - createPostTag( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: CreatePostTagInput! - ): CreatePostTagPayload + """Starts with the specified string (case-insensitive).""" + startsWithInsensitive: String +} - """Creates a single \`Tag\`.""" - createTag( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: CreateTagInput! - ): CreateTagPayload +type Tag { + color: String + createdAt: Datetime + description: String + id: UUID! + name: String! - """Creates a single \`User\`.""" - createUser( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: CreateUserInput! - ): CreateUserPayload + """Reads and enables pagination through a set of \`PostTag\`.""" + postTags( + """Read all values in the set after (below) this cursor.""" + after: Cursor - """Creates a single \`Comment\`.""" - createComment( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: CreateCommentInput! - ): CreateCommentPayload + """Read all values in the set before (above) this cursor.""" + before: Cursor - """Creates a single \`Post\`.""" - createPost( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: CreatePostInput! - ): CreatePostPayload + """Only read the first \`n\` values of the set.""" + first: Int - """Updates a single \`PostTag\` using a unique key and a patch.""" - updatePostTag( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: UpdatePostTagInput! - ): UpdatePostTagPayload + """Only read the last \`n\` values of the set.""" + last: Int - """Updates a single \`Tag\` using a unique key and a patch.""" - updateTag( """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor + based pagination. May not be used with \`last\`. """ - input: UpdateTagInput! - ): UpdateTagPayload + offset: Int - """Updates a single \`User\` using a unique key and a patch.""" - updateUser( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: UpdateUserInput! - ): UpdateUserPayload + """The method to use when ordering \`PostTag\`.""" + orderBy: [PostTagOrderBy!] = [PRIMARY_KEY_ASC] - """Updates a single \`Comment\` using a unique key and a patch.""" - updateComment( """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + A filter to be used in determining which values should be returned by the collection. """ - input: UpdateCommentInput! - ): UpdateCommentPayload + where: PostTagFilter + ): PostTagConnection! - """Updates a single \`Post\` using a unique key and a patch.""" - updatePost( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: UpdatePostInput! - ): UpdatePostPayload + """Reads and enables pagination through a set of \`Post\`.""" + posts( + """Read all values in the set after (below) this cursor.""" + after: Cursor - """Deletes a single \`PostTag\` using a unique key.""" - deletePostTag( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: DeletePostTagInput! - ): DeletePostTagPayload + """Read all values in the set before (above) this cursor.""" + before: Cursor - """Deletes a single \`Tag\` using a unique key.""" - deleteTag( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: DeleteTagInput! - ): DeleteTagPayload + """Only read the first \`n\` values of the set.""" + first: Int - """Deletes a single \`User\` using a unique key.""" - deleteUser( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: DeleteUserInput! - ): DeleteUserPayload + """Only read the last \`n\` values of the set.""" + last: Int - """Deletes a single \`Comment\` using a unique key.""" - deleteComment( """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor + based pagination. May not be used with \`last\`. """ - input: DeleteCommentInput! - ): DeleteCommentPayload + offset: Int - """Deletes a single \`Post\` using a unique key.""" - deletePost( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: DeletePostInput! - ): DeletePostPayload + """The method to use when ordering \`Post\`.""" + orderBy: [PostOrderBy!] = [PRIMARY_KEY_ASC] - """ - Provision an S3 bucket for a logical bucket in the database. - Reads the bucket config via RLS, then creates and configures - the S3 bucket with the appropriate privacy policies, CORS rules, - and lifecycle settings. - """ - provisionBucket( """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. + A filter to be used in determining which values should be returned by the collection. """ - input: ProvisionBucketInput! - ): ProvisionBucketPayload + where: PostFilter + ): TagPostsManyToManyConnection! + slug: String! } -"""The output of our create \`PostTag\` mutation.""" -type CreatePostTagPayload { +"""A connection to a list of \`Tag\` values.""" +type TagConnection { """ - The exact same \`clientMutationId\` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. + A list of edges which contains the \`Tag\` and cursor to aid in pagination. """ - clientMutationId: String + edges: [TagEdge]! - """The \`PostTag\` that was created by this mutation.""" - postTag: PostTag + """A list of \`Tag\` objects.""" + nodes: [Tag]! - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query + """Information to aid in pagination.""" + pageInfo: PageInfo! - """An edge for our \`PostTag\`. May be used by Relay 1.""" - postTagEdge( - """The method to use when ordering \`PostTag\`.""" - orderBy: [PostTagOrderBy!]! = [PRIMARY_KEY_ASC] - ): PostTagEdge + """The count of *all* \`Tag\` you could get from the connection.""" + totalCount: Int! } -"""All input for the create \`PostTag\` mutation.""" -input CreatePostTagInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String +"""A \`Tag\` edge in the connection.""" +type TagEdge { + """A cursor for use in pagination.""" + cursor: Cursor - """The \`PostTag\` to be created by this mutation.""" - postTag: PostTagInput! + """The \`Tag\` at the end of the edge.""" + node: Tag } -"""An input for mutations affecting \`PostTag\`""" -input PostTagInput { - id: UUID - postId: UUID! - tagId: UUID! - createdAt: Datetime -} +""" +A filter to be used against \`Tag\` object types. All fields are combined with a logical ‘and.’ +""" +input TagFilter { + """Checks for all expressions in this list.""" + and: [TagFilter!] -"""The output of our create \`Tag\` mutation.""" -type CreateTagPayload { - """ - The exact same \`clientMutationId\` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. - """ - clientMutationId: String + """Filter by the object’s \`color\` field.""" + color: StringFilter - """The \`Tag\` that was created by this mutation.""" - tag: Tag + """Filter by the object’s \`createdAt\` field.""" + createdAt: DatetimeFilter - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query + """Filter by the object’s \`description\` field.""" + description: StringFilter - """An edge for our \`Tag\`. May be used by Relay 1.""" - tagEdge( - """The method to use when ordering \`Tag\`.""" - orderBy: [TagOrderBy!]! = [PRIMARY_KEY_ASC] - ): TagEdge -} + """Filter by the object’s \`id\` field.""" + id: UUIDFilter -"""All input for the create \`Tag\` mutation.""" -input CreateTagInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String + """Filter by the object’s \`name\` field.""" + name: StringFilter + + """Negates the expression.""" + not: TagFilter + + """Checks for any expressions in this list.""" + or: [TagFilter!] + + """Filter by the object’s \`postTags\` relation.""" + postTags: TagToManyPostTagFilter - """The \`Tag\` to be created by this mutation.""" - tag: TagInput! + """\`postTags\` exist.""" + postTagsExist: Boolean + + """Filter by the object’s \`slug\` field.""" + slug: StringFilter } """An input for mutations affecting \`Tag\`""" input TagInput { + color: String + createdAt: Datetime + description: String id: UUID name: String! slug: String! - description: String - color: String - createdAt: Datetime } -"""The output of our create \`User\` mutation.""" -type CreateUserPayload { - """ - The exact same \`clientMutationId\` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. - """ - clientMutationId: String +"""Methods to use when ordering \`Tag\`.""" +enum TagOrderBy { + COLOR_ASC + COLOR_DESC + CREATED_AT_ASC + CREATED_AT_DESC + DESCRIPTION_ASC + DESCRIPTION_DESC + ID_ASC + ID_DESC + NAME_ASC + NAME_DESC + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + SLUG_ASC + SLUG_DESC +} - """The \`User\` that was created by this mutation.""" - user: User +"""Represents an update to a \`Tag\`. Fields that are set will be updated.""" +input TagPatch { + color: String + createdAt: Datetime + description: String + id: UUID + name: String + slug: String +} +"""A connection to a list of \`Post\` values, with data from \`PostTag\`.""" +type TagPostsManyToManyConnection { """ - Our root query field type. Allows us to run any query from our mutation payload. + A list of edges which contains the \`Post\`, info from the \`PostTag\`, and the cursor to aid in pagination. """ - query: Query + edges: [TagPostsManyToManyEdge!]! - """An edge for our \`User\`. May be used by Relay 1.""" - userEdge( - """The method to use when ordering \`User\`.""" - orderBy: [UserOrderBy!]! = [PRIMARY_KEY_ASC] - ): UserEdge -} + """A list of \`Post\` objects.""" + nodes: [Post]! -"""All input for the create \`User\` mutation.""" -input CreateUserInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String + """Information to aid in pagination.""" + pageInfo: PageInfo! - """The \`User\` to be created by this mutation.""" - user: UserInput! + """The count of *all* \`Post\` you could get from the connection.""" + totalCount: Int! } -"""An input for mutations affecting \`User\`""" -input UserInput { - id: UUID - email: String! - username: String! - displayName: String - bio: String - isActive: Boolean - role: String +"""A \`Post\` edge in the connection, with data from \`PostTag\`.""" +type TagPostsManyToManyEdge { createdAt: Datetime - updatedAt: Datetime -} - -"""The output of our create \`Comment\` mutation.""" -type CreateCommentPayload { - """ - The exact same \`clientMutationId\` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. - """ - clientMutationId: String - - """The \`Comment\` that was created by this mutation.""" - comment: Comment - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query + """A cursor for use in pagination.""" + cursor: Cursor + id: UUID! - """An edge for our \`Comment\`. May be used by Relay 1.""" - commentEdge( - """The method to use when ordering \`Comment\`.""" - orderBy: [CommentOrderBy!]! = [PRIMARY_KEY_ASC] - ): CommentEdge + """The \`Post\` at the end of the edge.""" + node: Post } -"""All input for the create \`Comment\` mutation.""" -input CreateCommentInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String +""" +A filter to be used against many \`PostTag\` object types. All fields are combined with a logical ‘and.’ +""" +input TagToManyPostTagFilter { + """Filters to entities where every related entity matches.""" + every: PostTagFilter - """The \`Comment\` to be created by this mutation.""" - comment: CommentInput! -} + """Filters to entities where no related entity matches.""" + none: PostTagFilter -"""An input for mutations affecting \`Comment\`""" -input CommentInput { - id: UUID - postId: UUID! - authorId: UUID! - parentId: UUID - content: String! - isApproved: Boolean - likesCount: Int - createdAt: Datetime - updatedAt: Datetime + """Filters to entities where at least one related entity matches.""" + some: PostTagFilter } -"""The output of our create \`Post\` mutation.""" -type CreatePostPayload { - """ - The exact same \`clientMutationId\` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. - """ - clientMutationId: String - - """The \`Post\` that was created by this mutation.""" - post: Post +""" +A universally unique identifier as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122). +""" +scalar UUID +""" +A filter to be used against UUID fields. All fields are combined with a logical ‘and.’ +""" +input UUIDFilter { """ - Our root query field type. Allows us to run any query from our mutation payload. + Not equal to the specified value, treating null like an ordinary value. """ - query: Query + distinctFrom: UUID - """An edge for our \`Post\`. May be used by Relay 1.""" - postEdge( - """The method to use when ordering \`Post\`.""" - orderBy: [PostOrderBy!]! = [PRIMARY_KEY_ASC] - ): PostEdge -} + """Equal to the specified value.""" + equalTo: UUID -"""All input for the create \`Post\` mutation.""" -input CreatePostInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String + """Greater than the specified value.""" + greaterThan: UUID - """The \`Post\` to be created by this mutation.""" - post: PostInput! -} + """Greater than or equal to the specified value.""" + greaterThanOrEqualTo: UUID -"""An input for mutations affecting \`Post\`""" -input PostInput { - id: UUID - authorId: UUID! - title: String! - slug: String! - content: String - excerpt: String - isPublished: Boolean - publishedAt: Datetime - viewCount: Int - createdAt: Datetime - updatedAt: Datetime -} + """Included in the specified list.""" + in: [UUID!] -"""The output of our update \`PostTag\` mutation.""" -type UpdatePostTagPayload { """ - The exact same \`clientMutationId\` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. + Is null (if \`true\` is specified) or is not null (if \`false\` is specified). """ - clientMutationId: String + isNull: Boolean - """The \`PostTag\` that was updated by this mutation.""" - postTag: PostTag + """Less than the specified value.""" + lessThan: UUID - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query + """Less than or equal to the specified value.""" + lessThanOrEqualTo: UUID - """An edge for our \`PostTag\`. May be used by Relay 1.""" - postTagEdge( - """The method to use when ordering \`PostTag\`.""" - orderBy: [PostTagOrderBy!]! = [PRIMARY_KEY_ASC] - ): PostTagEdge + """Equal to the specified value, treating null like an ordinary value.""" + notDistinctFrom: UUID + + """Not equal to the specified value.""" + notEqualTo: UUID + + """Not included in the specified list.""" + notIn: [UUID!] } -"""All input for the \`updatePostTag\` mutation.""" -input UpdatePostTagInput { +"""All input for the \`updateComment\` mutation.""" +input UpdateCommentInput { """ An arbitrary string value with no semantic meaning. Will be included in the payload verbatim. May be used to track mutations by the client. """ clientMutationId: String - id: UUID! - - """ - An object where the defined keys will be set on the \`PostTag\` being updated. - """ - postTagPatch: PostTagPatch! -} -""" -Represents an update to a \`PostTag\`. Fields that are set will be updated. -""" -input PostTagPatch { - id: UUID - postId: UUID - tagId: UUID - createdAt: Datetime + """ + An object where the defined keys will be set on the \`Comment\` being updated. + """ + commentPatch: CommentPatch! + id: UUID! } -"""The output of our update \`Tag\` mutation.""" -type UpdateTagPayload { +"""The output of our update \`Comment\` mutation.""" +type UpdateCommentPayload { """ The exact same \`clientMutationId\` that was provided in the mutation input, unchanged and unused. May be used by a client to track mutations. """ clientMutationId: String - """The \`Tag\` that was updated by this mutation.""" - tag: Tag + """The \`Comment\` that was updated by this mutation.""" + comment: Comment + + """An edge for our \`Comment\`. May be used by Relay 1.""" + commentEdge( + """The method to use when ordering \`Comment\`.""" + orderBy: [CommentOrderBy!]! = [PRIMARY_KEY_ASC] + ): CommentEdge """ Our root query field type. Allows us to run any query from our mutation payload. """ query: Query - - """An edge for our \`Tag\`. May be used by Relay 1.""" - tagEdge( - """The method to use when ordering \`Tag\`.""" - orderBy: [TagOrderBy!]! = [PRIMARY_KEY_ASC] - ): TagEdge } -"""All input for the \`updateTag\` mutation.""" -input UpdateTagInput { +"""All input for the \`updatePost\` mutation.""" +input UpdatePostInput { """ An arbitrary string value with no semantic meaning. Will be included in the payload verbatim. May be used to track mutations by the client. @@ -2116,46 +2114,36 @@ input UpdateTagInput { id: UUID! """ - An object where the defined keys will be set on the \`Tag\` being updated. + An object where the defined keys will be set on the \`Post\` being updated. """ - tagPatch: TagPatch! -} - -"""Represents an update to a \`Tag\`. Fields that are set will be updated.""" -input TagPatch { - id: UUID - name: String - slug: String - description: String - color: String - createdAt: Datetime + postPatch: PostPatch! } -"""The output of our update \`User\` mutation.""" -type UpdateUserPayload { +"""The output of our update \`Post\` mutation.""" +type UpdatePostPayload { """ The exact same \`clientMutationId\` that was provided in the mutation input, unchanged and unused. May be used by a client to track mutations. """ clientMutationId: String - """The \`User\` that was updated by this mutation.""" - user: User + """The \`Post\` that was updated by this mutation.""" + post: Post + + """An edge for our \`Post\`. May be used by Relay 1.""" + postEdge( + """The method to use when ordering \`Post\`.""" + orderBy: [PostOrderBy!]! = [PRIMARY_KEY_ASC] + ): PostEdge """ Our root query field type. Allows us to run any query from our mutation payload. """ query: Query - - """An edge for our \`User\`. May be used by Relay 1.""" - userEdge( - """The method to use when ordering \`User\`.""" - orderBy: [UserOrderBy!]! = [PRIMARY_KEY_ASC] - ): UserEdge } -"""All input for the \`updateUser\` mutation.""" -input UpdateUserInput { +"""All input for the \`updatePostTag\` mutation.""" +input UpdatePostTagInput { """ An arbitrary string value with no semantic meaning. Will be included in the payload verbatim. May be used to track mutations by the client. @@ -2164,49 +2152,36 @@ input UpdateUserInput { id: UUID! """ - An object where the defined keys will be set on the \`User\` being updated. + An object where the defined keys will be set on the \`PostTag\` being updated. """ - userPatch: UserPatch! -} - -"""Represents an update to a \`User\`. Fields that are set will be updated.""" -input UserPatch { - id: UUID - email: String - username: String - displayName: String - bio: String - isActive: Boolean - role: String - createdAt: Datetime - updatedAt: Datetime + postTagPatch: PostTagPatch! } -"""The output of our update \`Comment\` mutation.""" -type UpdateCommentPayload { +"""The output of our update \`PostTag\` mutation.""" +type UpdatePostTagPayload { """ The exact same \`clientMutationId\` that was provided in the mutation input, unchanged and unused. May be used by a client to track mutations. """ clientMutationId: String - """The \`Comment\` that was updated by this mutation.""" - comment: Comment + """The \`PostTag\` that was updated by this mutation.""" + postTag: PostTag + + """An edge for our \`PostTag\`. May be used by Relay 1.""" + postTagEdge( + """The method to use when ordering \`PostTag\`.""" + orderBy: [PostTagOrderBy!]! = [PRIMARY_KEY_ASC] + ): PostTagEdge """ Our root query field type. Allows us to run any query from our mutation payload. """ query: Query - - """An edge for our \`Comment\`. May be used by Relay 1.""" - commentEdge( - """The method to use when ordering \`Comment\`.""" - orderBy: [CommentOrderBy!]! = [PRIMARY_KEY_ASC] - ): CommentEdge } -"""All input for the \`updateComment\` mutation.""" -input UpdateCommentInput { +"""All input for the \`updateTag\` mutation.""" +input UpdateTagInput { """ An arbitrary string value with no semantic meaning. Will be included in the payload verbatim. May be used to track mutations by the client. @@ -2215,51 +2190,36 @@ input UpdateCommentInput { id: UUID! """ - An object where the defined keys will be set on the \`Comment\` being updated. + An object where the defined keys will be set on the \`Tag\` being updated. """ - commentPatch: CommentPatch! -} - -""" -Represents an update to a \`Comment\`. Fields that are set will be updated. -""" -input CommentPatch { - id: UUID - postId: UUID - authorId: UUID - parentId: UUID - content: String - isApproved: Boolean - likesCount: Int - createdAt: Datetime - updatedAt: Datetime + tagPatch: TagPatch! } -"""The output of our update \`Post\` mutation.""" -type UpdatePostPayload { +"""The output of our update \`Tag\` mutation.""" +type UpdateTagPayload { """ The exact same \`clientMutationId\` that was provided in the mutation input, unchanged and unused. May be used by a client to track mutations. """ clientMutationId: String - """The \`Post\` that was updated by this mutation.""" - post: Post - """ Our root query field type. Allows us to run any query from our mutation payload. """ query: Query - """An edge for our \`Post\`. May be used by Relay 1.""" - postEdge( - """The method to use when ordering \`Post\`.""" - orderBy: [PostOrderBy!]! = [PRIMARY_KEY_ASC] - ): PostEdge + """The \`Tag\` that was updated by this mutation.""" + tag: Tag + + """An edge for our \`Tag\`. May be used by Relay 1.""" + tagEdge( + """The method to use when ordering \`Tag\`.""" + orderBy: [TagOrderBy!]! = [PRIMARY_KEY_ASC] + ): TagEdge } -"""All input for the \`updatePost\` mutation.""" -input UpdatePostInput { +"""All input for the \`updateUser\` mutation.""" +input UpdateUserInput { """ An arbitrary string value with no semantic meaning. Will be included in the payload verbatim. May be used to track mutations by the client. @@ -2268,219 +2228,258 @@ input UpdatePostInput { id: UUID! """ - An object where the defined keys will be set on the \`Post\` being updated. + An object where the defined keys will be set on the \`User\` being updated. """ - postPatch: PostPatch! -} - -"""Represents an update to a \`Post\`. Fields that are set will be updated.""" -input PostPatch { - id: UUID - authorId: UUID - title: String - slug: String - content: String - excerpt: String - isPublished: Boolean - publishedAt: Datetime - viewCount: Int - createdAt: Datetime - updatedAt: Datetime + userPatch: UserPatch! } -"""The output of our delete \`PostTag\` mutation.""" -type DeletePostTagPayload { +"""The output of our update \`User\` mutation.""" +type UpdateUserPayload { """ The exact same \`clientMutationId\` that was provided in the mutation input, unchanged and unused. May be used by a client to track mutations. """ clientMutationId: String - """The \`PostTag\` that was deleted by this mutation.""" - postTag: PostTag - """ Our root query field type. Allows us to run any query from our mutation payload. """ query: Query - """An edge for our \`PostTag\`. May be used by Relay 1.""" - postTagEdge( - """The method to use when ordering \`PostTag\`.""" - orderBy: [PostTagOrderBy!]! = [PRIMARY_KEY_ASC] - ): PostTagEdge + """The \`User\` that was updated by this mutation.""" + user: User + + """An edge for our \`User\`. May be used by Relay 1.""" + userEdge( + """The method to use when ordering \`User\`.""" + orderBy: [UserOrderBy!]! = [PRIMARY_KEY_ASC] + ): UserEdge } -"""All input for the \`deletePostTag\` mutation.""" -input DeletePostTagInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String +type User { + """Reads and enables pagination through a set of \`Comment\`.""" + authoredComments( + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Only read the first \`n\` values of the set.""" + first: Int + + """Only read the last \`n\` values of the set.""" + last: Int + + """ + Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor + based pagination. May not be used with \`last\`. + """ + offset: Int + + """The method to use when ordering \`Comment\`.""" + orderBy: [CommentOrderBy!] = [PRIMARY_KEY_ASC] + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: CommentFilter + ): CommentConnection! + + """Reads and enables pagination through a set of \`Post\`.""" + authoredPosts( + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """Only read the first \`n\` values of the set.""" + first: Int + + """Only read the last \`n\` values of the set.""" + last: Int + + """ + Skip the first \`n\` values from our \`after\` cursor, an alternative to cursor + based pagination. May not be used with \`last\`. + """ + offset: Int + + """The method to use when ordering \`Post\`.""" + orderBy: [PostOrderBy!] = [PRIMARY_KEY_ASC] + + """ + A filter to be used in determining which values should be returned by the collection. + """ + where: PostFilter + ): PostConnection! + bio: String + createdAt: Datetime + displayName: String + email: String! id: UUID! + isActive: Boolean + role: String + updatedAt: Datetime + username: String! } -"""The output of our delete \`Tag\` mutation.""" -type DeleteTagPayload { +"""A connection to a list of \`User\` values.""" +type UserConnection { """ - The exact same \`clientMutationId\` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. + A list of edges which contains the \`User\` and cursor to aid in pagination. """ - clientMutationId: String + edges: [UserEdge]! - """The \`Tag\` that was deleted by this mutation.""" - tag: Tag + """A list of \`User\` objects.""" + nodes: [User]! - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query + """Information to aid in pagination.""" + pageInfo: PageInfo! - """An edge for our \`Tag\`. May be used by Relay 1.""" - tagEdge( - """The method to use when ordering \`Tag\`.""" - orderBy: [TagOrderBy!]! = [PRIMARY_KEY_ASC] - ): TagEdge + """The count of *all* \`User\` you could get from the connection.""" + totalCount: Int! } -"""All input for the \`deleteTag\` mutation.""" -input DeleteTagInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String - id: UUID! +"""A \`User\` edge in the connection.""" +type UserEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The \`User\` at the end of the edge.""" + node: User } -"""The output of our delete \`User\` mutation.""" -type DeleteUserPayload { - """ - The exact same \`clientMutationId\` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. - """ - clientMutationId: String +""" +A filter to be used against \`User\` object types. All fields are combined with a logical ‘and.’ +""" +input UserFilter { + """Checks for all expressions in this list.""" + and: [UserFilter!] - """The \`User\` that was deleted by this mutation.""" - user: User + """Filter by the object’s \`authoredComments\` relation.""" + authoredComments: UserToManyCommentFilter - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query + """\`authoredComments\` exist.""" + authoredCommentsExist: Boolean - """An edge for our \`User\`. May be used by Relay 1.""" - userEdge( - """The method to use when ordering \`User\`.""" - orderBy: [UserOrderBy!]! = [PRIMARY_KEY_ASC] - ): UserEdge -} + """Filter by the object’s \`authoredPosts\` relation.""" + authoredPosts: UserToManyPostFilter -"""All input for the \`deleteUser\` mutation.""" -input DeleteUserInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String - id: UUID! -} + """\`authoredPosts\` exist.""" + authoredPostsExist: Boolean -"""The output of our delete \`Comment\` mutation.""" -type DeleteCommentPayload { - """ - The exact same \`clientMutationId\` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. - """ - clientMutationId: String + """Filter by the object’s \`bio\` field.""" + bio: StringFilter - """The \`Comment\` that was deleted by this mutation.""" - comment: Comment + """Filter by the object’s \`createdAt\` field.""" + createdAt: DatetimeFilter - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query + """Filter by the object’s \`displayName\` field.""" + displayName: StringFilter - """An edge for our \`Comment\`. May be used by Relay 1.""" - commentEdge( - """The method to use when ordering \`Comment\`.""" - orderBy: [CommentOrderBy!]! = [PRIMARY_KEY_ASC] - ): CommentEdge -} + """Filter by the object’s \`email\` field.""" + email: StringFilter -"""All input for the \`deleteComment\` mutation.""" -input DeleteCommentInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String - id: UUID! -} + """Filter by the object’s \`id\` field.""" + id: UUIDFilter -"""The output of our delete \`Post\` mutation.""" -type DeletePostPayload { - """ - The exact same \`clientMutationId\` that was provided in the mutation input, - unchanged and unused. May be used by a client to track mutations. - """ - clientMutationId: String + """Filter by the object’s \`isActive\` field.""" + isActive: BooleanFilter - """The \`Post\` that was deleted by this mutation.""" - post: Post + """Negates the expression.""" + not: UserFilter - """ - Our root query field type. Allows us to run any query from our mutation payload. - """ - query: Query + """Checks for any expressions in this list.""" + or: [UserFilter!] - """An edge for our \`Post\`. May be used by Relay 1.""" - postEdge( - """The method to use when ordering \`Post\`.""" - orderBy: [PostOrderBy!]! = [PRIMARY_KEY_ASC] - ): PostEdge + """Filter by the object’s \`role\` field.""" + role: StringFilter + + """Filter by the object’s \`updatedAt\` field.""" + updatedAt: DatetimeFilter + + """Filter by the object’s \`username\` field.""" + username: StringFilter } -"""All input for the \`deletePost\` mutation.""" -input DeletePostInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String - id: UUID! +"""An input for mutations affecting \`User\`""" +input UserInput { + bio: String + createdAt: Datetime + displayName: String + email: String! + id: UUID + isActive: Boolean + role: String + updatedAt: Datetime + username: String! } -input ProvisionBucketInput { - """The logical bucket key (e.g., "public", "private")""" - bucketKey: String! +"""Methods to use when ordering \`User\`.""" +enum UserOrderBy { + BIO_ASC + BIO_DESC + CREATED_AT_ASC + CREATED_AT_DESC + DISPLAY_NAME_ASC + DISPLAY_NAME_DESC + EMAIL_ASC + EMAIL_DESC + ID_ASC + ID_DESC + IS_ACTIVE_ASC + IS_ACTIVE_DESC + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + ROLE_ASC + ROLE_DESC + UPDATED_AT_ASC + UPDATED_AT_DESC + USERNAME_ASC + USERNAME_DESC +} - """ - Owner entity ID for entity-scoped bucket provisioning. - Omit for app-level (database-wide) storage. - """ - ownerId: UUID +"""Represents an update to a \`User\`. Fields that are set will be updated.""" +input UserPatch { + bio: String + createdAt: Datetime + displayName: String + email: String + id: UUID + isActive: Boolean + role: String + updatedAt: Datetime + username: String } -type ProvisionBucketPayload { - """Whether provisioning succeeded""" - success: Boolean! +""" +A filter to be used against many \`Comment\` object types. All fields are combined with a logical ‘and.’ +""" +input UserToManyCommentFilter { + """Filters to entities where every related entity matches.""" + every: CommentFilter - """The S3 bucket name that was provisioned""" - bucketName: String! + """Filters to entities where no related entity matches.""" + none: CommentFilter - """The access type applied""" - accessType: String! + """Filters to entities where at least one related entity matches.""" + some: CommentFilter +} - """The storage provider used""" - provider: String! +""" +A filter to be used against many \`Post\` object types. All fields are combined with a logical ‘and.’ +""" +input UserToManyPostFilter { + """Filters to entities where every related entity matches.""" + every: PostFilter - """The S3 endpoint (null for AWS S3 default)""" - endpoint: String + """Filters to entities where no related entity matches.""" + none: PostFilter - """Error message if provisioning failed""" - error: String + """Filters to entities where at least one related entity matches.""" + some: PostFilter }" `; diff --git a/pgpm/core/__tests__/core/__snapshots__/plan-writing.test.ts.snap b/pgpm/core/__tests__/core/__snapshots__/plan-writing.test.ts.snap index 5cd6963dd0..9d8826c430 100644 --- a/pgpm/core/__tests__/core/__snapshots__/plan-writing.test.ts.snap +++ b/pgpm/core/__tests__/core/__snapshots__/plan-writing.test.ts.snap @@ -49,21 +49,21 @@ include $(PGXS) "plan": "%syntax-version=1.0.0 %project=pg-verify %uri=pg-verify -procedures/verify_view [pg-utilities:procedures/tg_update_timestamps] 2017-08-11T08:11:51Z constructive # add procedures/verify_view -procedures/verify_type 2017-08-11T08:11:51Z constructive # add procedures/verify_type -procedures/verify_trigger 2017-08-11T08:11:51Z constructive # add procedures/verify_trigger +procedures/verify_constraint [pg-utilities:procedures/tg_update_timestamps] 2017-08-11T08:11:51Z constructive # add procedures/verify_constraint +procedures/verify_domain 2017-08-11T08:11:51Z constructive # add procedures/verify_domain +procedures/verify_extension 2017-08-11T08:11:51Z constructive # add procedures/verify_extension +procedures/verify_function 2017-08-11T08:11:51Z constructive # add procedures/verify_function +procedures/verify_index 2017-08-11T08:11:51Z constructive # add procedures/verify_index +procedures/verify_membership 2017-08-11T08:11:51Z constructive # add procedures/verify_membership +procedures/verify_policy 2017-08-11T08:11:51Z constructive # add procedures/verify_policy +procedures/verify_role 2017-08-11T08:11:51Z constructive # add procedures/verify_role +procedures/verify_schema 2017-08-11T08:11:51Z constructive # add procedures/verify_schema +procedures/verify_security 2017-08-11T08:11:51Z constructive # add procedures/verify_security procedures/verify_table_grant 2017-08-11T08:11:51Z constructive # add procedures/verify_table_grant procedures/verify_table 2017-08-11T08:11:51Z constructive # add procedures/verify_table -procedures/verify_security 2017-08-11T08:11:51Z constructive # add procedures/verify_security -procedures/verify_schema 2017-08-11T08:11:51Z constructive # add procedures/verify_schema -procedures/verify_role 2017-08-11T08:11:51Z constructive # add procedures/verify_role -procedures/verify_policy 2017-08-11T08:11:51Z constructive # add procedures/verify_policy -procedures/verify_membership 2017-08-11T08:11:51Z constructive # add procedures/verify_membership -procedures/verify_index 2017-08-11T08:11:51Z constructive # add procedures/verify_index -procedures/verify_function 2017-08-11T08:11:51Z constructive # add procedures/verify_function -procedures/verify_extension 2017-08-11T08:11:51Z constructive # add procedures/verify_extension -procedures/verify_domain 2017-08-11T08:11:51Z constructive # add procedures/verify_domain -procedures/verify_constraint 2017-08-11T08:11:51Z constructive # add procedures/verify_constraint", +procedures/verify_trigger 2017-08-11T08:11:51Z constructive # add procedures/verify_trigger +procedures/verify_type 2017-08-11T08:11:51Z constructive # add procedures/verify_type +procedures/verify_view 2017-08-11T08:11:51Z constructive # add procedures/verify_view", "required": [ "some-native-module", "pg-utilities", diff --git a/pgpm/core/__tests__/core/__snapshots__/workspace-extensions-dependency-order.test.ts.snap b/pgpm/core/__tests__/core/__snapshots__/workspace-extensions-dependency-order.test.ts.snap index 93e954bc6d..dc648fe6c6 100644 --- a/pgpm/core/__tests__/core/__snapshots__/workspace-extensions-dependency-order.test.ts.snap +++ b/pgpm/core/__tests__/core/__snapshots__/workspace-extensions-dependency-order.test.ts.snap @@ -28,12 +28,12 @@ exports[`getWorkspaceExtensionsInDependencyOrder with complex existing fixtures "resolved": [ "plpgsql", "uuid-ossp", + "pgcrypto", "pg-utilities", "pg-verify", - "pgcrypto", "totp", - "utils", "secrets", + "utils", ], } `; @@ -84,12 +84,12 @@ exports[`getWorkspaceExtensionsInDependencyOrder with existing fixtures returns "resolved": [ "plpgsql", "uuid-ossp", + "pgcrypto", "pg-utilities", "pg-verify", - "pgcrypto", "totp", - "utils", "secrets", + "utils", ], } `; diff --git a/pgpm/core/__tests__/files/plan/__snapshots__/sample-unique-names-plan-w-exts.test.ts.snap b/pgpm/core/__tests__/files/plan/__snapshots__/sample-unique-names-plan-w-exts.test.ts.snap index e386ef5b3d..2b907b082b 100644 --- a/pgpm/core/__tests__/files/plan/__snapshots__/sample-unique-names-plan-w-exts.test.ts.snap +++ b/pgpm/core/__tests__/files/plan/__snapshots__/sample-unique-names-plan-w-exts.test.ts.snap @@ -6,9 +6,9 @@ exports[`w-exts fixture plan generation (sample-unique-names) generates a plan f %uri=sample-unique-names schemas/unique_names/schema 2017-08-11T08:11:51Z constructive # add schemas/unique_names/schema schemas/unique_names/tables/words/table [schemas/unique_names/schema] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/tables/words/table -schemas/unique_names/tables/words/indexes/words_type_idx [schemas/unique_names/schema schemas/unique_names/tables/words/table] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/tables/words/indexes/words_type_idx +schemas/unique_names/procedures/generate_name [schemas/unique_names/schema schemas/unique_names/tables/words/table] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/procedures/generate_name schemas/unique_names/tables/words/fixtures/1589271124916_fixture [schemas/unique_names/schema schemas/unique_names/tables/words/table] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/tables/words/fixtures/1589271124916_fixture -schemas/unique_names/procedures/generate_name [schemas/unique_names/schema schemas/unique_names/tables/words/table] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/procedures/generate_name" +schemas/unique_names/tables/words/indexes/words_type_idx [schemas/unique_names/schema schemas/unique_names/tables/words/table] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/tables/words/indexes/words_type_idx" `; exports[`w-exts fixture plan generation (sample-unique-names) generates a plan for sample-unique-names (with packages and includeTags) 1`] = ` @@ -17,9 +17,9 @@ exports[`w-exts fixture plan generation (sample-unique-names) generates a plan f %uri=sample-unique-names schemas/unique_names/schema [pgpm-base32:schemas/base32/procedures/decode pgpm-verify:@0.1.0] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/schema schemas/unique_names/tables/words/table [schemas/unique_names/schema] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/tables/words/table -schemas/unique_names/tables/words/indexes/words_type_idx [schemas/unique_names/schema schemas/unique_names/tables/words/table] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/tables/words/indexes/words_type_idx +schemas/unique_names/procedures/generate_name [schemas/unique_names/schema schemas/unique_names/tables/words/table] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/procedures/generate_name schemas/unique_names/tables/words/fixtures/1589271124916_fixture [schemas/unique_names/schema schemas/unique_names/tables/words/table] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/tables/words/fixtures/1589271124916_fixture -schemas/unique_names/procedures/generate_name [schemas/unique_names/schema schemas/unique_names/tables/words/table] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/procedures/generate_name" +schemas/unique_names/tables/words/indexes/words_type_idx [schemas/unique_names/schema schemas/unique_names/tables/words/table] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/tables/words/indexes/words_type_idx" `; exports[`w-exts fixture plan generation (sample-unique-names) generates a plan for sample-unique-names (with packages) 1`] = ` @@ -28,7 +28,7 @@ exports[`w-exts fixture plan generation (sample-unique-names) generates a plan f %uri=sample-unique-names schemas/unique_names/schema [pgpm-base32:schemas/base32/procedures/decode pgpm-verify:procedures/verify_view] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/schema schemas/unique_names/tables/words/table [schemas/unique_names/schema] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/tables/words/table -schemas/unique_names/tables/words/indexes/words_type_idx [schemas/unique_names/schema schemas/unique_names/tables/words/table] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/tables/words/indexes/words_type_idx +schemas/unique_names/procedures/generate_name [schemas/unique_names/schema schemas/unique_names/tables/words/table] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/procedures/generate_name schemas/unique_names/tables/words/fixtures/1589271124916_fixture [schemas/unique_names/schema schemas/unique_names/tables/words/table] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/tables/words/fixtures/1589271124916_fixture -schemas/unique_names/procedures/generate_name [schemas/unique_names/schema schemas/unique_names/tables/words/table] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/procedures/generate_name" +schemas/unique_names/tables/words/indexes/words_type_idx [schemas/unique_names/schema schemas/unique_names/tables/words/table] 2017-08-11T08:11:51Z constructive # add schemas/unique_names/tables/words/indexes/words_type_idx" `; diff --git a/pgpm/core/__tests__/resolution/__snapshots__/dependency-resolution-basic.test.ts.snap b/pgpm/core/__tests__/resolution/__snapshots__/dependency-resolution-basic.test.ts.snap index dd042b21ea..b3ff59760e 100644 --- a/pgpm/core/__tests__/resolution/__snapshots__/dependency-resolution-basic.test.ts.snap +++ b/pgpm/core/__tests__/resolution/__snapshots__/dependency-resolution-basic.test.ts.snap @@ -14,9 +14,6 @@ exports[`sqitch package dependencies [simple/1st] 1`] = ` }, "external": [], "resolved": [ - "schema_myfirstapp", - "table_users", - "schema_myfirstapp", "schema_myfirstapp", "table_users", "table_products", @@ -38,8 +35,6 @@ exports[`sqitch package dependencies [simple/2nd] 1`] = ` }, "external": [], "resolved": [ - "create_schema", - "create_table", "create_schema", "create_table", "create_another_table", diff --git a/pgpm/core/__tests__/resolution/__snapshots__/dependency-resolution-internal-tags.test.ts.snap b/pgpm/core/__tests__/resolution/__snapshots__/dependency-resolution-internal-tags.test.ts.snap index bf2372f38e..5ad67df00d 100644 --- a/pgpm/core/__tests__/resolution/__snapshots__/dependency-resolution-internal-tags.test.ts.snap +++ b/pgpm/core/__tests__/resolution/__snapshots__/dependency-resolution-internal-tags.test.ts.snap @@ -14,9 +14,6 @@ exports[`sqitch package dependencies with internal tag resolution [simple-w-tags }, "external": [], "resolved": [ - "schema_myfirstapp", - "table_users", - "schema_myfirstapp", "schema_myfirstapp", "table_users", "table_products", @@ -41,11 +38,8 @@ exports[`sqitch package dependencies with internal tag resolution [simple-w-tags }, "external": [ "my-first:@v1.0.0", - "my-first:@v1.0.0", ], "resolved": [ - "create_schema", - "create_table", "create_schema", "create_table", "create_another_table", @@ -155,9 +149,9 @@ exports[`w-exts fixture dependency resolution - internal tags resolves internal "resolved": [ "schemas/unique_names/schema", "schemas/unique_names/tables/words/table", - "schemas/unique_names/tables/words/indexes/words_type_idx", - "schemas/unique_names/tables/words/fixtures/1589271124916_fixture", "schemas/unique_names/procedures/generate_name", + "schemas/unique_names/tables/words/fixtures/1589271124916_fixture", + "schemas/unique_names/tables/words/indexes/words_type_idx", ], "resolvedTags": {}, } diff --git a/pgpm/core/__tests__/resolution/__snapshots__/dependency-resolution-resolved-tags.test.ts.snap b/pgpm/core/__tests__/resolution/__snapshots__/dependency-resolution-resolved-tags.test.ts.snap index 46ff9f762a..8c4f5340ff 100644 --- a/pgpm/core/__tests__/resolution/__snapshots__/dependency-resolution-resolved-tags.test.ts.snap +++ b/pgpm/core/__tests__/resolution/__snapshots__/dependency-resolution-resolved-tags.test.ts.snap @@ -14,9 +14,6 @@ exports[`sqitch package dependencies with resolved tags [simple-w-tags/1st] 1`] }, "external": [], "resolved": [ - "schema_myfirstapp", - "table_users", - "schema_myfirstapp", "schema_myfirstapp", "table_users", "table_products", @@ -41,11 +38,8 @@ exports[`sqitch package dependencies with resolved tags [simple-w-tags/2nd] 1`] }, "external": [ "my-first:table_users", - "my-first:table_users", ], "resolved": [ - "create_schema", - "create_table", "create_schema", "create_table", "create_another_table", @@ -146,9 +140,9 @@ exports[`w-exts fixture dependency resolution - resolved tags resolves tags to c "resolved": [ "schemas/unique_names/schema", "schemas/unique_names/tables/words/table", - "schemas/unique_names/tables/words/indexes/words_type_idx", - "schemas/unique_names/tables/words/fixtures/1589271124916_fixture", "schemas/unique_names/procedures/generate_name", + "schemas/unique_names/tables/words/fixtures/1589271124916_fixture", + "schemas/unique_names/tables/words/indexes/words_type_idx", ], "resolvedTags": {}, } diff --git a/pgpm/core/__tests__/resolution/__snapshots__/dependency-resolution-with-tags.test.ts.snap b/pgpm/core/__tests__/resolution/__snapshots__/dependency-resolution-with-tags.test.ts.snap index 1e44d52725..480b02d2b0 100644 --- a/pgpm/core/__tests__/resolution/__snapshots__/dependency-resolution-with-tags.test.ts.snap +++ b/pgpm/core/__tests__/resolution/__snapshots__/dependency-resolution-with-tags.test.ts.snap @@ -14,9 +14,6 @@ exports[`sqitch package dependencies [simple-w-tags/1st] 1`] = ` }, "external": [], "resolved": [ - "schema_myfirstapp", - "table_users", - "schema_myfirstapp", "schema_myfirstapp", "table_users", "table_products", @@ -41,11 +38,8 @@ exports[`sqitch package dependencies [simple-w-tags/2nd] 1`] = ` }, "external": [ "my-first:@v1.0.0", - "my-first:@v1.0.0", ], "resolved": [ - "create_schema", - "create_table", "create_schema", "create_table", "create_another_table", diff --git a/pgpm/core/src/core/class/pgpm.ts b/pgpm/core/src/core/class/pgpm.ts index 49668823c2..552d6448c8 100644 --- a/pgpm/core/src/core/class/pgpm.ts +++ b/pgpm/core/src/core/class/pgpm.ts @@ -165,7 +165,7 @@ export class PgpmPackage { ); const resolvedDirs = dirs.map(dir => path.resolve(dir)); // Remove duplicates by converting to Set and back to array - return [...new Set(resolvedDirs)]; + return [...new Set(resolvedDirs.sort((a, b) => a.localeCompare(b)))]; } private loadAllowedParentDirs(): string[] { @@ -286,7 +286,7 @@ export class PgpmPackage { const moduleFiles = glob.sync(`${this.workspacePath}/**/*.control`).filter( (file: string) => !/node_modules/.test(file) - ); + ).sort((a, b) => a.localeCompare(b)); // Group files by module name to handle collisions const filesByName = new Map(); diff --git a/pgpm/core/src/resolution/deps.ts b/pgpm/core/src/resolution/deps.ts index 5e44922bfa..fc0037d91b 100644 --- a/pgpm/core/src/resolution/deps.ts +++ b/pgpm/core/src/resolution/deps.ts @@ -95,8 +95,6 @@ function createDependencyResolver( resolved: string[], unresolved: string[] ): void { - unresolved.push(sqlmodule); - let moduleToResolve = sqlmodule; let edges: string[] | undefined; let returnEarly = false; @@ -110,6 +108,14 @@ function createDependencyResolver( edges = deps[makeKey(sqlmodule)]; } + // Avoid re-resolving a module already resolved; moduleToResolve may differ + // from sqlmodule when project-prefixed or tag-resolved references are normalized. + if (resolved.includes(moduleToResolve)) { + return; + } + + unresolved.push(sqlmodule); + // Handle external dependencies if no edges found if (!edges) { if (handleExternalDep) { @@ -466,7 +472,7 @@ export const resolveDependencies = ( const tagMappings: Record = {}; // Process SQL files and build dependency graph - const files = glob(`${packageDir}/deploy/**/*.sql`); + const files = glob(`${packageDir}/deploy/**/*.sql`).sort((a, b) => a.localeCompare(b)); for (const file of files) { const data = readFileSync(file, 'utf-8'); diff --git a/pgpm/export/src/export-utils.ts b/pgpm/export/src/export-utils.ts index d0037b4f71..4c197e5686 100644 --- a/pgpm/export/src/export-utils.ts +++ b/pgpm/export/src/export-utils.ts @@ -380,7 +380,10 @@ export const installMissingModules = async ( export const makeReplacer = ({ schemas, name, schemaPrefix }: MakeReplacerOptions): ReplacerResult => { const replacements: [string, string] = ['constructive-extension-name', name]; const prefix = schemaPrefix || name; - const schemaReplacers: [string, string][] = schemas.map((schema) => [ + const sortedSchemas = [...schemas].sort((a, b) => + b.schema_name.length - a.schema_name.length || a.schema_name.localeCompare(b.schema_name) + ); + const schemaReplacers: [string, string][] = sortedSchemas.map((schema) => [ schema.schema_name, toSnakeCase(`${prefix}_${schema.name}`) ]); @@ -423,7 +426,7 @@ export const preparePackage = async ({ process.chdir(pgpmDir); try { - const plan = glob(path.join(pgpmDir, 'pgpm.plan')); + const plan = glob(path.join(pgpmDir, 'pgpm.plan')).sort((a, b) => a.localeCompare(b)); if (!plan.length) { const { fullName, email } = parseAuthor(author);