feat: update samples subgraph to 0.2.0#132
Open
dls-graph-schema-federator[bot] wants to merge 1 commit intomainfrom
Open
feat: update samples subgraph to 0.2.0#132dls-graph-schema-federator[bot] wants to merge 1 commit intomainfrom
dls-graph-schema-federator[bot] wants to merge 1 commit intomainfrom
Conversation
@@ -78,11 +78,26 @@ input CreateOrValidateSampleInput
"""URL of the JSON schema the samples' `data` should be validated against"""
dataSchemaUrl: String!
+ """Samples to be created"""
+ samples: [SampleIn!]!
+
+ """
+ Whether or not the provided samples should only be validated and not created
+ """
+ validateOnly: Boolean! = false
+
"""Number of the proposal the samples should be associated with"""
proposalNumber: Int!
"""Number of the instrument session the samples should be associated with"""
instrumentSessionNumber: Int!
+}
+
+input CreateOrValidateSampleInputBase
+ @join__type(graph: SAMPLES)
+{
+ """URL of the JSON schema the samples' `data` should be validated against"""
+ dataSchemaUrl: String!
"""Samples to be created"""
samples: [SampleIn!]!
@@ -167,24 +182,53 @@ type Instrument
type InstrumentSession
@join__type(graph: INSTRUMENT_SESSIONS, key: "instrumentSessionNumber proposal {proposalNumber}")
+ @join__type(graph: SAMPLES, key: "instrumentSessionNumber proposal { proposalNumber }")
+{
+ instrumentSessionId: Int! @join__field(graph: INSTRUMENT_SESSIONS)
+ instrumentSessionNumber: Int! @join__field(graph: INSTRUMENT_SESSIONS) @join__field(graph: SAMPLES, external: true)
+ startTime: DateTime @join__field(graph: INSTRUMENT_SESSIONS)
+ endTime: DateTime @join__field(graph: INSTRUMENT_SESSIONS)
+ type: String @join__field(graph: INSTRUMENT_SESSIONS)
+ state: String @join__field(graph: INSTRUMENT_SESSIONS)
+ riskRating: String @join__field(graph: INSTRUMENT_SESSIONS)
+ proposal: Proposal @join__field(graph: INSTRUMENT_SESSIONS) @join__field(graph: SAMPLES, external: true)
+ instrument: Instrument! @join__field(graph: INSTRUMENT_SESSIONS)
+ roles: [InstrumentSessionRole!]! @join__field(graph: INSTRUMENT_SESSIONS)
+
+ """Samples associated with a given instrument session"""
+ samples(first: Int!, filter: SampleFilterInput! = {}, before: String = null, after: String = null, last: Int = null, orderBy: SampleOrder! = {}): SampleConnection! @join__field(graph: SAMPLES)
+}
+
+type InstrumentSessionConnection
+ @join__type(graph: SAMPLES)
{
- instrumentSessionId: Int!
+ edges: [InstrumentSessionEdge!]!
+ pageInfo: PageInfo!
+}
+
+type InstrumentSessionEdge
+ @join__type(graph: SAMPLES)
+{
+ cursor: String!
+ node: InstrumentSession!
+}
+
+input InstrumentSessionInput
+ @join__type(graph: SAMPLES)
+{
+ proposalNumber: Int!
instrumentSessionNumber: Int!
- startTime: DateTime
- endTime: DateTime
- type: String
- state: String
- riskRating: String
- proposal: Proposal
- instrument: Instrument!
- roles: [InstrumentSessionRole!]!
}
type InstrumentSessionMutations
@join__type(graph: INSTRUMENT_SESSIONS, key: "instrumentSessionNumber proposalNumber")
+ @join__type(graph: SAMPLES, key: "instrumentSessionNumber proposalNumber")
{
- instrumentSessionNumber: Int!
- proposalNumber: Int!
+ instrumentSessionNumber: Int! @join__field(graph: INSTRUMENT_SESSIONS) @join__field(graph: SAMPLES, external: true)
+ proposalNumber: Int! @join__field(graph: INSTRUMENT_SESSIONS) @join__field(graph: SAMPLES, external: true)
+
+ """Create or validate samples associated with this instrument session"""
+ createOrValidateSamples(input: CreateOrValidateSampleInputBase!): CreateSamplesResponse! @join__field(graph: SAMPLES)
}
type InstrumentSessionRole
@@ -218,6 +262,24 @@ scalar JSON
scalar JSONObject
@join__type(graph: WORKFLOWS)
+input JSONOperator
+ @join__type(graph: SAMPLES)
+{
+ stringOperator: StringOperatorInput = null
+ datetimeOperator: DatetimeOperatorInput = null
+ numericOperator: NumericOperatorInput = null
+}
+
+input JSONOperatorInput
+ @join__type(graph: SAMPLES)
+{
+ """A JSON path specifying the value to filter. Must start with '$.'"""
+ path: String!
+
+ """The operator to apply to the JSON field"""
+ operator: JSONOperator!
+}
+
scalar link__Import
enum link__Purpose {
@@ -250,12 +312,26 @@ type Mutation
@join__type(graph: WORKFLOWS)
{
instrumentSession(proposalNumber: Int!, instrumentSessionNumber: Int!): InstrumentSessionMutations @join__field(graph: INSTRUMENT_SESSIONS)
- createSamples(input: CreateSampleInput!): [Sample!]! @join__field(graph: SAMPLES) @deprecated(reason: "Will be replaced by createOrValidateSamples")
createOrValidateSamples(input: CreateOrValidateSampleInput!): CreateSamplesResponse! @join__field(graph: SAMPLES)
+ createSamples(input: CreateSampleInput!): [Sample!]! @join__field(graph: SAMPLES) @deprecated(reason: "Will be replaced by createOrValidateSamples")
sample(sampleId: UUID!): SampleMutations @join__field(graph: SAMPLES)
submitWorkflowTemplate(name: String!, visit: VisitInput!, parameters: JSON!): Workflow! @join__field(graph: WORKFLOWS)
}
+input NumericOperatorInput
+ @join__type(graph: SAMPLES)
+{
+ """
+ Will filter to items where the numeric field is greater than the provided value
+ """
+ gt: Float = null
+
+ """
+ Will filter to items where the numeric field is less than the provided value
+ """
+ lt: Float = null
+}
+
"""Information about pagination in a connection"""
type PageInfo
@join__type(graph: INSTRUMENT_SESSIONS)
@@ -277,15 +353,16 @@ type PageInfo
type Proposal
@join__type(graph: INSTRUMENT_SESSIONS, key: "proposalNumber")
+ @join__type(graph: SAMPLES, key: "proposalNumber")
{
- proposalNumber: Int!
- proposalCategory: String
- title: String
- summary: String
- state: ProposalState!
- instrumentSessions: [InstrumentSession!]!
- instruments: [Instrument!]!
- roles: [ProposalAccount!]!
+ proposalNumber: Int! @join__field(graph: INSTRUMENT_SESSIONS) @join__field(graph: SAMPLES, external: true)
+ proposalCategory: String @join__field(graph: INSTRUMENT_SESSIONS)
+ title: String @join__field(graph: INSTRUMENT_SESSIONS)
+ summary: String @join__field(graph: INSTRUMENT_SESSIONS)
+ state: ProposalState! @join__field(graph: INSTRUMENT_SESSIONS)
+ instrumentSessions: [InstrumentSession!]! @join__field(graph: INSTRUMENT_SESSIONS)
+ instruments: [Instrument!]! @join__field(graph: INSTRUMENT_SESSIONS)
+ roles: [ProposalAccount!]! @join__field(graph: INSTRUMENT_SESSIONS)
}
type ProposalAccount
@@ -345,12 +422,12 @@ type Query
"""Get an account"""
account(username: String!): Account @join__field(graph: INSTRUMENT_SESSIONS)
+ """Get a list of samples associated with a given instrument session"""
+ samples(first: Int!, instrumentSessions: [InstrumentSessionInput!] = null, filter: SampleFilterInput! = {}, before: String = null, after: String = null, last: Int = null, orderBy: SampleOrder! = {}): SampleConnection! @join__field(graph: SAMPLES)
+
"""Get a sample by its id"""
sample(sampleId: UUID!): Sample @join__field(graph: SAMPLES)
- """Get a list of samples associated with a given instrument session"""
- samples(proposalNumber: Int!, instrumentSessionNumber: Int!, first: Int!, filter: SampleFilterInput! = {}, before: String = null, after: String = null, last: Int = null, orderBy: SampleOrder! = {}): SampleConnection! @join__field(graph: SAMPLES)
-
"""Get a single [`Workflow`] by proposal, visit, and name"""
workflow(visit: VisitInput!, name: String!): Workflow! @join__field(graph: WORKFLOWS)
workflows(visit: VisitInput!, cursor: String, limit: Int, filter: WorkflowFilter): WorkflowConnection! @join__field(graph: WORKFLOWS)
@@ -379,6 +456,10 @@ type Sample
"""The JSON schema that the sample's `data` conforms to"""
dataSchema: JSON!
+
+ """The instrument sessions that this sample is associated with"""
+ instrumentSessions: InstrumentSessionConnection! @join__field(graph: SAMPLES, provides: "edges{ node{ instrumentSessionNumber proposal{ proposalNumber }}}")
+ images: [SampleImage!]!
}
type SampleConnection
@@ -431,6 +512,16 @@ input SampleFilterInput
"""Filter on the `name` field of `Sample`"""
name: StringOperatorInput = null
+
+ """Filter on the `data` field of `Sample`"""
+ data: [JSONOperatorInput!] = null
+}
+
+type SampleImage
+ @join__type(graph: SAMPLES)
+{
+ url: String!
+ filename: String!
}
input SampleIn
@@ -459,6 +550,7 @@ type SampleMutations
sampleId: UUID!
linkInstrumentSessionToSample(proposalNumber: Int!, instrumentSessionNumber: Int!): Void
addSampleEvent(sampleEvent: AddSampleEventInput!): SampleEvent!
+ createSampleImageUploadUrl(filename: String!, contentType: String!, contentLength: Int!): String!
}
input SampleOrder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Repository
Subgraph maintainers
@DiamondLightSource/ulims