feat: update instrument_sessions subgraph to test#16
Open
mattprit-test[bot] wants to merge 1 commit into
Open
Conversation
@@ -20,6 +20,36 @@ directive @join__unionMember(graph: join__Graph!, member: String!) repeatable on
directive @link(url: String, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA
+type Account
+ @join__type(graph: INSTRUMENT_SESSIONS)
+{
+ accountId: Int!
+ username: String!
+ emailAddress: String
+ title: String
+ givenName: String
+ familyName: String
+ type: AccountType!
+ state: AccountState!
+ proposalRoles: [ProposalAccount!]!
+ instrumentSessionRoles: [InstrumentSessionRole!]!
+}
+
+enum AccountState
+ @join__type(graph: INSTRUMENT_SESSIONS)
+{
+ enabled @join__enumValue(graph: INSTRUMENT_SESSIONS)
+ disabled @join__enumValue(graph: INSTRUMENT_SESSIONS)
+}
+
+enum AccountType
+ @join__type(graph: INSTRUMENT_SESSIONS)
+{
+ user @join__enumValue(graph: INSTRUMENT_SESSIONS)
+ staff @join__enumValue(graph: INSTRUMENT_SESSIONS)
+ functional @join__enumValue(graph: INSTRUMENT_SESSIONS)
+}
+
type Artifact
@join__type(graph: WORKFLOWS)
{
@@ -33,17 +63,49 @@ type Artifact
mimeType: String!
}
-"""
-Implement the DateTime<Utc> scalar
-
-The input/output is a string in RFC3339 format.
-"""
+"""Date with time (isoformat)"""
scalar DateTime
+ @join__type(graph: INSTRUMENT_SESSIONS)
@join__type(graph: WORKFLOWS)
+type Instrument
+ @join__type(graph: INSTRUMENT_SESSIONS)
+{
+ name: String!
+ scienceGroup: String
+ description: String
+ proposals: [Proposal!]!
+ instrumentSessions: [InstrumentSession!]!
+}
+
+type InstrumentSession
+ @join__type(graph: INSTRUMENT_SESSIONS)
+{
+ instrumentSessionId: Int!
+ instrumentSessionNumber: Int!
+ startTime: DateTime
+ endTime: DateTime
+ type: String
+ state: String
+ riskRating: String
+ proposal: Proposal
+ instrument: Instrument!
+ roles: [InstrumentSessionRole!]!
+}
+
+type InstrumentSessionRole
+ @join__type(graph: INSTRUMENT_SESSIONS)
+{
+ instrumentSession: InstrumentSession!
+ account: Account!
+ role: String!
+ onSite: Boolean!
+}
+
scalar join__FieldSet
enum join__Graph {
+ INSTRUMENT_SESSIONS @join__graph(name: "instrument_sessions", url: "https://instrument-sessions.diamond.ac.uk/api/graphql")
WORKFLOWS @join__graph(name: "workflows", url: "https://workflows.diamond.ac.uk/graphql")
}
@@ -93,15 +155,66 @@ type PageInfo
endCursor: String
}
+type Proposal
+ @join__type(graph: INSTRUMENT_SESSIONS)
+{
+ proposalNumber: Int!
+ proposalCategory: String
+ title: String
+ summary: String
+ state: ProposalState!
+ instrumentSessions: [InstrumentSession!]!
+ instruments: [Instrument!]!
+ roles: [ProposalAccount!]!
+}
+
+type ProposalAccount
+ @join__type(graph: INSTRUMENT_SESSIONS)
+{
+ proposal: Proposal!
+ account: Account!
+ role: String!
+}
+
+enum ProposalState
+ @join__type(graph: INSTRUMENT_SESSIONS)
+{
+ Open @join__enumValue(graph: INSTRUMENT_SESSIONS)
+ Closed @join__enumValue(graph: INSTRUMENT_SESSIONS)
+ Cancelled @join__enumValue(graph: INSTRUMENT_SESSIONS)
+}
+
"""The root query of the service"""
type Query
+ @join__type(graph: INSTRUMENT_SESSIONS)
@join__type(graph: WORKFLOWS)
{
+ """Get a proposal by its number"""
+ proposal(proposalNumber: Int!): Proposal @join__field(graph: INSTRUMENT_SESSIONS)
+
+ """Get a list of proposals"""
+ proposals(proposalCategory: String = null): [Proposal!]! @join__field(graph: INSTRUMENT_SESSIONS)
+
+ """Get a instrument session"""
+ instrumentSession(proposalNumber: Int!, instrumentSessionNumber: Int!): InstrumentSession @join__field(graph: INSTRUMENT_SESSIONS)
+
+ """Get a instrument session"""
+ instrumentSessions(proposalNumber: Int = null, proposalCategory: String = null): [InstrumentSession!] @join__field(graph: INSTRUMENT_SESSIONS)
+
+ """Get an instrument"""
+ instrument(instrumentName: String!): Instrument @join__field(graph: INSTRUMENT_SESSIONS)
+
+ """Get a list of instruments"""
+ instruments(scienceGroup: String = null): [Instrument!]! @join__field(graph: INSTRUMENT_SESSIONS)
+
+ """Get an account"""
+ account(username: String!): Account @join__field(graph: INSTRUMENT_SESSIONS)
+
"""Get a single [`Workflow`] by proposal, visit, and name"""
- workflow(visit: VisitInput!, name: String!): Workflow!
- workflows(visit: VisitInput!, cursor: String, limit: Int, filter: WorkflowFilter): WorkflowConnection!
- workflowTemplate(name: String!): WorkflowTemplate!
- workflowTemplates(cursor: String, limit: Int): WorkflowTemplateConnection!
+ workflow(visit: VisitInput!, name: String!): Workflow! @join__field(graph: WORKFLOWS)
+ workflows(visit: VisitInput!, cursor: String, limit: Int, filter: WorkflowFilter): WorkflowConnection! @join__field(graph: WORKFLOWS)
+ workflowTemplate(name: String!): WorkflowTemplate! @join__field(graph: WORKFLOWS)
+ workflowTemplates(cursor: String, limit: Int): WorkflowTemplateConnection! @join__field(graph: WORKFLOWS)
}
type Task |
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