-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add experiments subgraph #173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,144 @@ | ||
| schema @link(url: "https://specs.apollo.dev/federation/v2.7", import: ["@external", "@key", "@provides", "@shareable"]) { | ||
| query: Query | ||
| mutation: Mutation | ||
| } | ||
|
|
||
| """Values required to create an experiment definition""" | ||
| input CreateExperimentDefinitionInput { | ||
| name: String! | ||
| data: JSON! | ||
| dataSchemaUrl: String! | ||
| proposalNumber: Int! | ||
| instrumentSessionNumber: Int! | ||
| } | ||
|
|
||
| """Values required for the createExperiments mutation""" | ||
| input CreateExperimentsInput { | ||
| experiments: [ExperimentInput!]! | ||
| } | ||
|
|
||
| """Date with time (isoformat)""" | ||
| scalar DateTime | ||
|
|
||
| type Experiment @key(fields: "id") { | ||
| id: UUID! | ||
| name: String! | ||
| createdTime: DateTime! | ||
| updatedTime: DateTime! | ||
| experimentDefinition: ExperimentDefinition! | ||
|
|
||
| """The sample that this experiment is associated with""" | ||
| sample: Sample! @provides(fields: "id") | ||
| } | ||
|
|
||
| type ExperimentConnection @shareable { | ||
| edges: [ExperimentEdge!]! | ||
| pageInfo: PageInfo! | ||
| } | ||
|
|
||
| type ExperimentDefinition { | ||
| id: UUID! | ||
| name: String! | ||
| createdTime: DateTime! | ||
| updatedTime: DateTime! | ||
| data: JSON! | ||
| dataSchemaUrl: String! | ||
| proposalNumber: Int! | ||
| instrumentSessionNumber: Int! | ||
|
|
||
| """ | ||
| The instrument session that this experiment definition is associated with | ||
| """ | ||
| instrumentSession: InstrumentSession! @provides(fields: "instrumentSessionNumber proposal{ proposalNumber }") | ||
|
|
||
| """Experiments associated with this experiment definition""" | ||
| experiments: [Experiment!]! | ||
| } | ||
|
|
||
| type ExperimentDefinitionConnection @shareable { | ||
| edges: [ExperimentDefinitionEdge!]! | ||
| pageInfo: PageInfo! | ||
| } | ||
|
|
||
| type ExperimentDefinitionEdge @shareable { | ||
| cursor: String! | ||
| node: ExperimentDefinition! | ||
| } | ||
|
|
||
| """Mutations for a given experiment defintion""" | ||
| type ExperimentDefinitionMutations { | ||
| createExperiments(input: CreateExperimentsInput!): [Experiment!]! | ||
| } | ||
|
|
||
| type ExperimentEdge @shareable { | ||
| cursor: String! | ||
| node: Experiment! | ||
| } | ||
|
|
||
| """Values required to create an experiment""" | ||
| input ExperimentInput { | ||
| name: String! | ||
| sampleId: UUID! | ||
| } | ||
|
|
||
| type InstrumentSession @key(fields: "instrumentSessionNumber proposal { proposalNumber }") { | ||
| instrumentSessionNumber: Int! @external | ||
| proposal: Proposal @external | ||
|
|
||
| """Experiment Definitions""" | ||
| experimentDefinitions(first: Int = null, last: Int = null, after: String = null, before: String = null): ExperimentDefinitionConnection! | ||
|
|
||
| """Experiments associated with this session""" | ||
| experiments(first: Int = null, last: Int = null, after: String = null, before: String = null): ExperimentConnection! | ||
| } | ||
|
|
||
| """Values required to uniquely identify an instrument session""" | ||
| input InstrumentSessionInput { | ||
| proposalNumber: Int! | ||
| instrumentSessionNumber: Int! | ||
| } | ||
|
|
||
| """ | ||
| The `JSON` scalar type represents JSON values as specified by [ECMA-404](https://ecma-international.org/wp-content/uploads/ECMA-404_2nd_edition_december_2017.pdf). | ||
| """ | ||
| scalar JSON @specifiedBy(url: "https://ecma-international.org/wp-content/uploads/ECMA-404_2nd_edition_december_2017.pdf") | ||
|
|
||
| type Mutation { | ||
| createExperimentDefinition(input: CreateExperimentDefinitionInput!): ExperimentDefinition | ||
| experimentDefinition(id: UUID!): ExperimentDefinitionMutations | ||
| } | ||
|
|
||
| type PageInfo @shareable { | ||
| startCursor: String | ||
| endCursor: String | ||
| hasNextPage: Boolean! | ||
| hasPreviousPage: Boolean! | ||
| } | ||
|
|
||
| type Proposal @key(fields: "proposalNumber") { | ||
| proposalNumber: Int! @external | ||
| } | ||
|
|
||
| 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 | ||
| experiment(id: UUID!): Experiment | ||
| experiments(instrumentSessions: [InstrumentSessionInput!]!, first: Int = null, last: Int = null, after: String = null, before: String = null): ExperimentConnection | ||
| } | ||
|
|
||
| type Sample @key(fields: "id") { | ||
| id: UUID! @external | ||
| experiments: [Experiment!]! | ||
| } | ||
|
|
||
| scalar UUID | ||
|
|
||
| scalar _Any | ||
|
|
||
| union _Entity = Experiment | InstrumentSession | Proposal | Sample | ||
|
|
||
| type _Service { | ||
| sdl: String! | ||
| } |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.