From 92ebe1f5cd53765751eb248aa823654abf255ffc Mon Sep 17 00:00:00 2001 From: Gustavo Madeira Krieger Date: Wed, 6 Mar 2024 16:53:18 -0300 Subject: [PATCH] feat(graphql): add new api schema to project --- api/graphql/output_unification_schema.graphql | 620 ++++++++++++++++++ 1 file changed, 620 insertions(+) create mode 100644 api/graphql/output_unification_schema.graphql diff --git a/api/graphql/output_unification_schema.graphql b/api/graphql/output_unification_schema.graphql new file mode 100644 index 000000000..e47bb9050 --- /dev/null +++ b/api/graphql/output_unification_schema.graphql @@ -0,0 +1,620 @@ +enum CompletionStatus { + ACCEPTED + CYCLE_LIMIT_EXCEEDED + EXCEPTION + MACHINE_HALTED + PAYLOAD_LENGTH_LIMIT_EXCEEDED + REJECTED + TIME_LIMIT_EXCEEDED + UNPROCESSED +} + +"""A location in a connection that can be used for resuming pagination.""" +scalar Cursor + +type Input implements Node { + blob: String! + index: Int! + + """ + A globally unique identifier. Can be used in various places throughout the system to identify this single value. + """ + nodeId: ID! + + """Reads and enables pagination through a set of `Output`.""" + outputsByInputIndex( + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """ + A condition to be used in determining which values should be returned by the collection. + """ + condition: OutputCondition + + """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 `Output`.""" + orderBy: [OutputsOrderBy!] = [PRIMARY_KEY_ASC] + ): OutputsConnection! + + """Reads and enables pagination through a set of `Proof`.""" + proofsByInputIndex( + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """ + A condition to be used in determining which values should be returned by the collection. + """ + condition: ProofCondition + + """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 `Proof`.""" + orderBy: [ProofsOrderBy!] = [PRIMARY_KEY_ASC] + ): ProofsConnection! + + """Reads and enables pagination through a set of `Report`.""" + reportsByInputIndex( + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """ + A condition to be used in determining which values should be returned by the collection. + """ + condition: ReportCondition + + """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 `Report`.""" + orderBy: [ReportsOrderBy!] = [PRIMARY_KEY_ASC] + ): ReportsConnection! + status: CompletionStatus! +} + +""" +A condition to be used against `Input` object types. All fields are tested for equality and combined with a logical ‘and.’ +""" +input InputCondition { + """Checks for equality with the object’s `blob` field.""" + blob: String + + """Checks for equality with the object’s `index` field.""" + index: Int + + """Checks for equality with the object’s `status` field.""" + status: CompletionStatus +} + +"""A connection to a list of `Input` values.""" +type InputsConnection { + """ + A list of edges which contains the `Input` and cursor to aid in pagination. + """ + edges: [InputsEdge!]! + + """A list of `Input` objects.""" + nodes: [Input!]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """The count of *all* `Input` you could get from the connection.""" + totalCount: Int! +} + +"""A `Input` edge in the connection.""" +type InputsEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `Input` at the end of the edge.""" + node: Input! +} + +"""Methods to use when ordering `Input`.""" +enum InputsOrderBy { + BLOB_ASC + BLOB_DESC + INDEX_ASC + INDEX_DESC + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + STATUS_ASC + STATUS_DESC +} + +"""An object with a globally unique `ID`.""" +interface Node { + """ + A globally unique identifier. Can be used in various places throughout the system to identify this single value. + """ + nodeId: ID! +} + +type Output implements Node { + blob: String! + index: Int! + + """Reads a single `Input` that is related to this `Output`.""" + inputByInputIndex: Input + inputIndex: Int! + + """ + A globally unique identifier. Can be used in various places throughout the system to identify this single value. + """ + nodeId: ID! + + """Reads a single `Proof` that is related to this `Output`.""" + proofByInputIndexAndOutputIndex: Proof +} + +""" +A condition to be used against `Output` object types. All fields are tested for equality and combined with a logical ‘and.’ +""" +input OutputCondition { + """Checks for equality with the object’s `blob` field.""" + blob: String + + """Checks for equality with the object’s `index` field.""" + index: Int + + """Checks for equality with the object’s `inputIndex` field.""" + inputIndex: Int +} + +"""A connection to a list of `Output` values.""" +type OutputsConnection { + """ + A list of edges which contains the `Output` and cursor to aid in pagination. + """ + edges: [OutputsEdge!]! + + """A list of `Output` objects.""" + nodes: [Output!]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """The count of *all* `Output` you could get from the connection.""" + totalCount: Int! +} + +"""A `Output` edge in the connection.""" +type OutputsEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `Output` at the end of the edge.""" + node: Output! +} + +"""Methods to use when ordering `Output`.""" +enum OutputsOrderBy { + BLOB_ASC + BLOB_DESC + INDEX_ASC + INDEX_DESC + INPUT_INDEX_ASC + INPUT_INDEX_DESC + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC +} + +"""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 Proof implements Node { + firstIndex: Int! + + """Reads a single `Input` that is related to this `Proof`.""" + inputByInputIndex: Input + inputIndex: Int! + lastInput: Int! + + """ + A globally unique identifier. Can be used in various places throughout the system to identify this single value. + """ + nodeId: ID! + + """Reads a single `Output` that is related to this `Proof`.""" + outputByInputIndexAndOutputIndex: Output + outputIndex: Int! + validityInputIndexWithinEpoch: Int! + validityMachineStateHash: String! + validityOutputEpochRootHash: String! + validityOutputHashInOutputHashesSiblings: [String]! + validityOutputHashesInEpochSiblings: [String]! + validityOutputHashesRootHash: String! + validityOutputIndexWithinInput: Int! +} + +""" +A condition to be used against `Proof` object types. All fields are tested for equality and combined with a logical ‘and.’ +""" +input ProofCondition { + """Checks for equality with the object’s `firstIndex` field.""" + firstIndex: Int + + """Checks for equality with the object’s `inputIndex` field.""" + inputIndex: Int + + """Checks for equality with the object’s `lastInput` field.""" + lastInput: Int + + """Checks for equality with the object’s `outputIndex` field.""" + outputIndex: Int + + """ + Checks for equality with the object’s `validityInputIndexWithinEpoch` field. + """ + validityInputIndexWithinEpoch: Int + + """ + Checks for equality with the object’s `validityMachineStateHash` field. + """ + validityMachineStateHash: String + + """ + Checks for equality with the object’s `validityOutputEpochRootHash` field. + """ + validityOutputEpochRootHash: String + + """ + Checks for equality with the object’s `validityOutputHashInOutputHashesSiblings` field. + """ + validityOutputHashInOutputHashesSiblings: [String] + + """ + Checks for equality with the object’s `validityOutputHashesInEpochSiblings` field. + """ + validityOutputHashesInEpochSiblings: [String] + + """ + Checks for equality with the object’s `validityOutputHashesRootHash` field. + """ + validityOutputHashesRootHash: String + + """ + Checks for equality with the object’s `validityOutputIndexWithinInput` field. + """ + validityOutputIndexWithinInput: Int +} + +"""A connection to a list of `Proof` values.""" +type ProofsConnection { + """ + A list of edges which contains the `Proof` and cursor to aid in pagination. + """ + edges: [ProofsEdge!]! + + """A list of `Proof` objects.""" + nodes: [Proof!]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """The count of *all* `Proof` you could get from the connection.""" + totalCount: Int! +} + +"""A `Proof` edge in the connection.""" +type ProofsEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `Proof` at the end of the edge.""" + node: Proof! +} + +"""Methods to use when ordering `Proof`.""" +enum ProofsOrderBy { + FIRST_INDEX_ASC + FIRST_INDEX_DESC + INPUT_INDEX_ASC + INPUT_INDEX_DESC + LAST_INPUT_ASC + LAST_INPUT_DESC + NATURAL + OUTPUT_INDEX_ASC + OUTPUT_INDEX_DESC + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC + VALIDITY_INPUT_INDEX_WITHIN_EPOCH_ASC + VALIDITY_INPUT_INDEX_WITHIN_EPOCH_DESC + VALIDITY_MACHINE_STATE_HASH_ASC + VALIDITY_MACHINE_STATE_HASH_DESC + VALIDITY_OUTPUT_EPOCH_ROOT_HASH_ASC + VALIDITY_OUTPUT_EPOCH_ROOT_HASH_DESC + VALIDITY_OUTPUT_HASHES_IN_EPOCH_SIBLINGS_ASC + VALIDITY_OUTPUT_HASHES_IN_EPOCH_SIBLINGS_DESC + VALIDITY_OUTPUT_HASHES_ROOT_HASH_ASC + VALIDITY_OUTPUT_HASHES_ROOT_HASH_DESC + VALIDITY_OUTPUT_HASH_IN_OUTPUT_HASHES_SIBLINGS_ASC + VALIDITY_OUTPUT_HASH_IN_OUTPUT_HASHES_SIBLINGS_DESC + VALIDITY_OUTPUT_INDEX_WITHIN_INPUT_ASC + VALIDITY_OUTPUT_INDEX_WITHIN_INPUT_DESC +} + +"""The root query type which gives access points into the data universe.""" +type Query implements Node { + """Reads and enables pagination through a set of `Input`.""" + allInputs( + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """ + A condition to be used in determining which values should be returned by the collection. + """ + condition: InputCondition + + """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 `Input`.""" + orderBy: [InputsOrderBy!] = [PRIMARY_KEY_ASC] + ): InputsConnection + + """Reads and enables pagination through a set of `Output`.""" + allOutputs( + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """ + A condition to be used in determining which values should be returned by the collection. + """ + condition: OutputCondition + + """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 `Output`.""" + orderBy: [OutputsOrderBy!] = [PRIMARY_KEY_ASC] + ): OutputsConnection + + """Reads and enables pagination through a set of `Proof`.""" + allProofs( + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """ + A condition to be used in determining which values should be returned by the collection. + """ + condition: ProofCondition + + """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 `Proof`.""" + orderBy: [ProofsOrderBy!] = [PRIMARY_KEY_ASC] + ): ProofsConnection + + """Reads and enables pagination through a set of `Report`.""" + allReports( + """Read all values in the set after (below) this cursor.""" + after: Cursor + + """Read all values in the set before (above) this cursor.""" + before: Cursor + + """ + A condition to be used in determining which values should be returned by the collection. + """ + condition: ReportCondition + + """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 `Report`.""" + orderBy: [ReportsOrderBy!] = [PRIMARY_KEY_ASC] + ): ReportsConnection + + """Reads a single `Input` using its globally unique `ID`.""" + input( + """The globally unique `ID` to be used in selecting a single `Input`.""" + nodeId: ID! + ): Input + inputByIndex(index: Int!): Input + + """Fetches an object given its globally unique `ID`.""" + node( + """The globally unique `ID`.""" + nodeId: ID! + ): Node + + """ + The root query type must be a `Node` to work well with Relay 1 mutations. This just resolves to `query`. + """ + nodeId: ID! + + """Reads a single `Output` using its globally unique `ID`.""" + output( + """The globally unique `ID` to be used in selecting a single `Output`.""" + nodeId: ID! + ): Output + outputByInputIndexAndIndex(index: Int!, inputIndex: Int!): Output + + """Reads a single `Proof` using its globally unique `ID`.""" + proof( + """The globally unique `ID` to be used in selecting a single `Proof`.""" + nodeId: ID! + ): Proof + proofByInputIndexAndOutputIndex(inputIndex: Int!, outputIndex: Int!): Proof + + """ + Exposes the root query type nested one level down. This is helpful for Relay 1 + which can only query top level fields if they are in a particular form. + """ + query: Query! + + """Reads a single `Report` using its globally unique `ID`.""" + report( + """The globally unique `ID` to be used in selecting a single `Report`.""" + nodeId: ID! + ): Report + reportByInputIndexAndIndex(index: Int!, inputIndex: Int!): Report +} + +type Report implements Node { + blob: String! + index: Int! + + """Reads a single `Input` that is related to this `Report`.""" + inputByInputIndex: Input + inputIndex: Int! + + """ + A globally unique identifier. Can be used in various places throughout the system to identify this single value. + """ + nodeId: ID! +} + +""" +A condition to be used against `Report` object types. All fields are tested for equality and combined with a logical ‘and.’ +""" +input ReportCondition { + """Checks for equality with the object’s `blob` field.""" + blob: String + + """Checks for equality with the object’s `index` field.""" + index: Int + + """Checks for equality with the object’s `inputIndex` field.""" + inputIndex: Int +} + +"""A connection to a list of `Report` values.""" +type ReportsConnection { + """ + A list of edges which contains the `Report` and cursor to aid in pagination. + """ + edges: [ReportsEdge!]! + + """A list of `Report` objects.""" + nodes: [Report!]! + + """Information to aid in pagination.""" + pageInfo: PageInfo! + + """The count of *all* `Report` you could get from the connection.""" + totalCount: Int! +} + +"""A `Report` edge in the connection.""" +type ReportsEdge { + """A cursor for use in pagination.""" + cursor: Cursor + + """The `Report` at the end of the edge.""" + node: Report! +} + +"""Methods to use when ordering `Report`.""" +enum ReportsOrderBy { + BLOB_ASC + BLOB_DESC + INDEX_ASC + INDEX_DESC + INPUT_INDEX_ASC + INPUT_INDEX_DESC + NATURAL + PRIMARY_KEY_ASC + PRIMARY_KEY_DESC +}