Skip to content
Merged
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
129 changes: 128 additions & 1 deletion schema/experiments.graphql
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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")
Expand All @@ -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
Expand Down Expand Up @@ -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
Comment thread
VictoriaBeilsten-Edmands marked this conversation as resolved.

"""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!
Expand Down Expand Up @@ -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 {
Comment thread
VictoriaBeilsten-Edmands marked this conversation as resolved.
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 {
Expand All @@ -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
}
Expand All @@ -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"""
Expand Down
Loading