diff --git a/src/apollo/queries.js b/src/apollo/queries.js index a5676220cc..138d8a3a49 100644 --- a/src/apollo/queries.js +++ b/src/apollo/queries.js @@ -1,61 +1,5 @@ import gql from 'graphql-tag'; -/** query for runsList sidebar */ -export const GET_RUNS = gql` - query getRunsList { - runsList { - gitSha - id - } - } -`; - -/** query for runMetadata and runDataset components */ -export const GET_RUN_DATA = gql` - query getRunData($runIds: [ID!]!, $showDiff: Boolean) { - runMetadata(runIds: $runIds) { - id - author - gitBranch - gitSha - runCommand - } - plots: runTrackingData(runIds: $runIds, showDiff: $showDiff, group: PLOT) { - ...trackingDatasetFields - } - metrics: runTrackingData( - runIds: $runIds - showDiff: $showDiff - group: METRIC - ) { - ...trackingDatasetFields - } - JSONData: runTrackingData( - runIds: $runIds - showDiff: $showDiff - group: JSON - ) { - ...trackingDatasetFields - } - } - - fragment trackingDatasetFields on TrackingDataset { - data - datasetName - datasetType - runIds - } -`; - -/** query for runMetricsData */ -export const GET_METRIC_PLOT_DATA = gql` - query getMetricPlotData($limit: Int) { - runMetricsData(limit: $limit) { - data - } - } -`; - /** query for obtaining installed and latest Kedro-Viz versions */ export const GET_VERSIONS = gql` query getVersion { diff --git a/src/apollo/schema.graphql b/src/apollo/schema.graphql index 2fd62c4204..3aa405737e 100644 --- a/src/apollo/schema.graphql +++ b/src/apollo/schema.graphql @@ -1,83 +1,8 @@ -""" -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") - -"""Metric data""" -type MetricPlotDataset { - data: JSON! -} - -type Mutation { - """Update run metadata""" - updateRunDetails(runId: ID!, runInput: RunInput!): UpdateRunDetailsResponse! -} - type Query { - """Get metadata for specified run_ids from the session store""" - runMetadata(runIds: [ID!]!): [Run!]! - - """Get metadata for all runs from the session store""" - runsList: [Run!]! - - """Get tracking datasets for specified group and run_ids""" - runTrackingData(runIds: [ID!]!, group: TrackingDatasetGroup!, showDiff: Boolean = true): [TrackingDataset!]! - - """Get metrics data for a limited number of recent runs""" - runMetricsData(limit: Int = 25): MetricPlotDataset! - """Get the installed and latest Kedro-Viz versions""" version: Version! } -"""Run metadata""" -type Run { - author: String - bookmark: Boolean - gitBranch: String - gitSha: String - id: ID! - notes: String - runCommand: String - title: String! -} - -"""Input to update run metadata""" -input RunInput { - bookmark: Boolean = null - notes: String = null - title: String = null -} - -"""Tracking data for a Run""" -type TrackingDataset { - data: JSON! - datasetName: String! - datasetType: String! - runIds: [ID!]! -} - -"""Group to show kind of tracking data""" -enum TrackingDatasetGroup { - PLOT - METRIC - JSON -} - -"""Response for unsuccessful update of run metadata""" -type UpdateRunDetailsFailure { - id: ID! - errorMessage: String! -} - -"""Response for update of run metadata""" -union UpdateRunDetailsResponse = UpdateRunDetailsSuccess | UpdateRunDetailsFailure - -"""Response for successful update of run metadata""" -type UpdateRunDetailsSuccess { - run: Run! -} - """Installed and latest Kedro-Viz versions""" type Version { installed: String! diff --git a/src/apollo/schema.js b/src/apollo/schema.js deleted file mode 100644 index 7c031bdb66..0000000000 --- a/src/apollo/schema.js +++ /dev/null @@ -1,73 +0,0 @@ -import { SchemaLink } from '@apollo/client/link/schema'; -import { makeExecutableSchema } from '@graphql-tools/schema'; -import GraphQLJSON, { GraphQLJSONObject } from 'graphql-type-json'; - -import gql from 'graphql-tag'; - -const typeDefs = gql` - """ - Generic scalar type representing a JSON object - """ - scalar JSONObject - - type Mutation { - updateRunDetails( - runId: ID! - runInput: RunInput! - ): UpdateUserDetailsResponse! - } - - type Query { - runsList: [Run!]! - runMetadata(runIds: [ID!]!): [Run!]! - runTrackingData( - runIds: [ID!]! - showDiff: Boolean = false - ): [TrackingDataset!]! - } - - type Run { - id: ID! - title: String! - author: String - gitBranch: String - gitSha: String - bookmark: Boolean - notes: String - runCommand: String - } - - input RunInput { - bookmark: Boolean = null - title: String = null - notes: String = null - } - - type TrackingDataset { - datasetName: String - datasetType: String - data: JSONObject - } - - type UpdateRunDetailsFailure { - id: ID! - errorMessage: String! - } - - union UpdateUserDetailsResponse = - UpdateUserDetailsSuccess - | UpdateRunDetailsFailure - - type UpdateUserDetailsSuccess { - run: Run! - } -`; - -const resolvers = { - JSON: GraphQLJSON, - JSONObject: GraphQLJSONObject, -}; - -export const schemaLink = new SchemaLink({ - schema: makeExecutableSchema({ typeDefs, resolvers }), -});