Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 60 additions & 2 deletions schema/experiments.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}
Comment thread
EmsArnold marked this conversation as resolved.

"""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
Expand Down
12 changes: 6 additions & 6 deletions supergraph-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading