From 03bfb6ad69d6383de71fe4ffaea92689b7753e76 Mon Sep 17 00:00:00 2001 From: "dls-graph-schema-federator[bot]" <183111110+dls-graph-schema-federator[bot]@users.noreply.github.com> Date: Wed, 12 Aug 2026 09:47:56 +0000 Subject: [PATCH] feat: update experiments schema to experiments experiments-0.3.0 --- schema/experiments.graphql | 129 ++++++++++++++++++++++++++++++++++++- 1 file changed, 128 insertions(+), 1 deletion(-) diff --git a/schema/experiments.graphql b/schema/experiments.graphql index 9cfbb55..7380f6c 100644 --- a/schema/experiments.graphql +++ b/schema/experiments.graphql @@ -1,3 +1,5 @@ +directive @oneOf on INPUT_OBJECT + schema @link(url: "https://specs.apollo.dev/federation/v2.7", import: ["@external", "@key", "@provides", "@shareable"]) { query: Query mutation: Mutation @@ -44,12 +46,59 @@ type CreateExperimentsResponse { """Date with time (isoformat)""" scalar DateTime +input DatetimeFilterInputV2 { + """ + Will filter to items where the `DateTime` field is greater than (i.e. after) the provided value + """ + greaterThan: DateTime = null + + """ + Will filter to items where the `DateTime` field is less than (i.e. before) the provided value + """ + lessThan: DateTime = null +} + +"""The details of an deleted record validation error""" +type DeleteErrorDetails { + """The type of error that occurred""" + type: String! + + """ + Tuple of strings identifying where in the record schema the error occurred. + """ + location: [String!]! + + """A human readable error message.""" + message: String! +} + +"""Return type when marking an record as deleted""" +type DeleteExperimentResponse { + """Whether the operation has succeeded without validation errors""" + success: Boolean! + + """Errors that occurred during validation""" + errors: [DeleteErrorDetails!]! +} + +"""Return type when marking an record as deleted""" +type DeletedExperimentDefinitionResponse { + """Whether the operation has succeeded without validation errors""" + success: Boolean! + + """Errors that occurred during validation""" + errors: [DeleteErrorDetails!]! +} + type Experiment @key(fields: "id") { id: UUID! name: String! createdTime: DateTime! updatedTime: DateTime! + deleted: Boolean! experimentDefinition: ExperimentDefinition! + createdBy: String! + modifiedBy: String! """The sample that this experiment is associated with""" sample: Sample! @provides(fields: "id") @@ -69,6 +118,9 @@ type ExperimentDefinition { dataSchemaUrl: String! proposalNumber: Int! instrumentSessionNumber: Int! + deleted: Boolean! + createdBy: String! + modifiedBy: String! """ The instrument session that this experiment definition is associated with @@ -103,6 +155,24 @@ type ExperimentDefinitionErrorDetails { message: String! } +"""Values required to filter a list of experiment definitions""" +input ExperimentDefinitionFilterInput { + """Filter by the name of experiment definitions""" + name: StringFilterInputV2 = null + + """Filter by the created datetime of experiment definitions""" + createdTime: DatetimeFilterInputV2 = null + + """Filter by the update datetime of experiment definitions""" + updatedTime: DatetimeFilterInputV2 = null + + """Filter by the data schema URL of experiment definitions""" + dataSchemaUrl: StringFilterInputV2 = null + + """Filter within the JSON data of experiment definitions""" + data: [JSONFilterInputV2!] = null +} + """Mutations for a given experiment defintion""" type ExperimentDefinitionMutations { updateExperimentDefinition(input: UpdateExperimentDefinitionInput!): UpdateExperimentDefinitionResponse! @@ -142,9 +212,39 @@ The `JSON` scalar type represents JSON values as specified by [ECMA-404](https:/ """ scalar JSON @specifiedBy(url: "https://ecma-international.org/wp-content/uploads/ECMA-404_2nd_edition_december_2017.pdf") +input JSONFilterConditionInput @oneOf { + stringFilter: StringFilterInputV2 = null + datetimeFilter: DatetimeFilterInputV2 = null + numericFilter: NumericFilterInputV2 = null +} + +input JSONFilterInputV2 { + """The JSON path to the field to filter. Must start with '$.'""" + path: String! + + """The filter operation to apply to the field""" + condition: JSONFilterConditionInput! +} + type Mutation { createExperimentDefinition(input: CreateExperimentDefinitionInput!): CreateExperimentDefinitionResponse experimentDefinition(id: UUID!): ExperimentDefinitionMutations + deleteExperiment(id: UUID!): DeleteExperimentResponse + restoreExperiment(id: UUID!): DeleteExperimentResponse + deleteExperimentDefinition(id: UUID!): DeletedExperimentDefinitionResponse + restoreExperimentDefinition(id: UUID!): DeletedExperimentDefinitionResponse +} + +input NumericFilterInputV2 { + """ + Will filter to items where the numeric field is greater than the provided value + """ + greaterThan: Float = null + + """ + Will filter to items where the numeric field is less than the provided value + """ + lessThan: Float = null } type PageInfo @shareable { @@ -162,7 +262,7 @@ type Query { _entities(representations: [_Any!]!): [_Entity]! _service: _Service! experimentDefinition(id: UUID!): ExperimentDefinition - experimentDefinitions(instrumentSessions: [InstrumentSessionInput!]!, first: Int = null, last: Int = null, after: String = null, before: String = null): ExperimentDefinitionConnection + experimentDefinitions(instrumentSessions: [InstrumentSessionInput!]!, filter: ExperimentDefinitionFilterInput = null, first: Int = null, last: Int = null, after: String = null, before: String = null): ExperimentDefinitionConnection experiment(id: UUID!): Experiment experiments(instrumentSessions: [InstrumentSessionInput!]!, first: Int = null, last: Int = null, after: String = null, before: String = null): ExperimentConnection } @@ -172,6 +272,33 @@ type Sample @key(fields: "id") { experiments: [Experiment!]! } +input StringFilterInputV2 { + """ + Will filter to items where the `String` field is a member of the provided value + """ + in: [String!] = null + + """ + Will filter to items where the `String` field is equal to the provided value + """ + equalTo: String = null + + """ + Will filter to items where the `String` field is not equal to the provided value + """ + notEqualTo: String = null + + """ + Will filter to items where the `String` field is not a member of the provided value + """ + notIn: [String!] = null + + """ + Will filter to items where the `String` field is contains the provided value + """ + contains: String = null +} + scalar UUID """Values that can be updated on experiment definition"""