From a126bfe7676e4f909141593bc08300dfbd899c7f Mon Sep 17 00:00:00 2001 From: "dls-graph-schema-federator[bot]" <183111110+dls-graph-schema-federator[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 11:13:13 +0000 Subject: [PATCH] feat: update experiments schema to experiments experiments-0.2.0 Rebase branch. --- schema/experiments.graphql | 62 ++++++++++++++++++++++++++++++++++++-- supergraph-config.yaml | 12 ++++---- 2 files changed, 66 insertions(+), 8 deletions(-) diff --git a/schema/experiments.graphql b/schema/experiments.graphql index 115d0ee..9cfbb55 100644 --- a/schema/experiments.graphql +++ b/schema/experiments.graphql @@ -12,11 +12,35 @@ input CreateExperimentDefinitionInput { instrumentSessionNumber: Int! } +"""Return type when creating an experiment definition""" +type CreateExperimentDefinitionResponse { + """Whether the operation has succeeded without validation errors""" + success: Boolean! + + """Experiment Definition that has been created""" + experimentDefinition: ExperimentDefinition + + """Errors that occurred during validation""" + errors: [ExperimentDefinitionErrorDetails!]! +} + """Values required for the createExperiments mutation""" input CreateExperimentsInput { experiments: [ExperimentInput!]! } +"""Return type when updating an experiment definition""" +type CreateExperimentsResponse { + """Whether the operation has succeeded without errors""" + success: Boolean! + + """Experiments created""" + experiments: [Experiment!] + + """Errors that occurred during experiments creation""" + errors: [String!]! +} + """Date with time (isoformat)""" scalar DateTime @@ -65,9 +89,24 @@ type ExperimentDefinitionEdge @shareable { node: ExperimentDefinition! } +"""The details of an experiment definition validation error""" +type ExperimentDefinitionErrorDetails { + """The type of error that occurred""" + type: String! + + """ + Tuple of strings identifying where in the experiment definition schema the error occurred. + """ + location: [String!]! + + """A human readable error message.""" + message: String! +} + """Mutations for a given experiment defintion""" type ExperimentDefinitionMutations { - createExperiments(input: CreateExperimentsInput!): [Experiment!]! + updateExperimentDefinition(input: UpdateExperimentDefinitionInput!): UpdateExperimentDefinitionResponse! + createExperiments(input: CreateExperimentsInput!): CreateExperimentsResponse! } type ExperimentEdge @shareable { @@ -104,7 +143,7 @@ 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") type Mutation { - createExperimentDefinition(input: CreateExperimentDefinitionInput!): ExperimentDefinition + createExperimentDefinition(input: CreateExperimentDefinitionInput!): CreateExperimentDefinitionResponse experimentDefinition(id: UUID!): ExperimentDefinitionMutations } @@ -135,6 +174,25 @@ type Sample @key(fields: "id") { scalar UUID +"""Values that can be updated on experiment definition""" +input UpdateExperimentDefinitionInput { + name: String + data: JSON + dataSchemaUrl: String +} + +"""Return type when updating an experiment definition""" +type UpdateExperimentDefinitionResponse { + """Whether the operation has succeeded without validation errors""" + success: Boolean! + + """Experiment Definition that has been updated""" + experimentDefinition: ExperimentDefinition + + """Errors that occurred during validation""" + errors: [ExperimentDefinitionErrorDetails!]! +} + scalar _Any union _Entity = Experiment | InstrumentSession | Proposal | Sample diff --git a/supergraph-config.yaml b/supergraph-config.yaml index be3a222..60b3390 100644 --- a/supergraph-config.yaml +++ b/supergraph-config.yaml @@ -11,15 +11,15 @@ subgraphs: routing_url: https://schemas.diamond.ac.uk/graphql schema: file: schema/schemas.graphql - - name: experiments - routing_url: https://api.experiment-definition.diamond.ac.uk/graphql + - name: samples + routing_url: https://sample-information.diamond.ac.uk/api/graphql schema: - file: schema/experiments.graphql + file: schema/samples.graphql - name: instrument_sessions routing_url: https://instrument-sessions.diamond.ac.uk/api/graphql schema: file: schema/instrument_sessions.graphql - - name: samples - routing_url: https://sample-information.diamond.ac.uk/api/graphql + - name: experiments + routing_url: https://api.experiment-definition.diamond.ac.uk/graphql schema: - file: schema/samples.graphql + file: schema/experiments.graphql