diff --git a/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/GmsGraphQLEngine.java b/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/GmsGraphQLEngine.java index af5d6bc81d614..db9bf304a1085 100644 --- a/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/GmsGraphQLEngine.java +++ b/datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/GmsGraphQLEngine.java @@ -1032,6 +1032,8 @@ private void configureQueryResolvers(final RuntimeWiring.Builder builder) { .dataFetcher("mlModel", getResolver(mlModelType)) .dataFetcher("mlModelGroup", getResolver(mlModelGroupType)) .dataFetcher("assertion", getResolver(assertionType)) + .dataFetcher("form", getResolver(formType)) + .dataFetcher("view", getResolver(dataHubViewType)) .dataFetcher("listPolicies", new ListPoliciesResolver(this.entityClient)) .dataFetcher("getGrantedPrivileges", new GetGrantedPrivilegesResolver()) .dataFetcher("listUsers", new ListUsersResolver(this.entityClient)) diff --git a/datahub-graphql-core/src/main/resources/entity.graphql b/datahub-graphql-core/src/main/resources/entity.graphql index a2440f7e3928e..941a6a28ceb2c 100644 --- a/datahub-graphql-core/src/main/resources/entity.graphql +++ b/datahub-graphql-core/src/main/resources/entity.graphql @@ -68,6 +68,17 @@ type Query { Fetch a Tag by primary key (urn) """ tag(urn: String!): Tag + + """ + Fetch a View by primary key (urn) + """ + view(urn: String!): DataHubView + + """ + Fetch a Form by primary key (urn) + """ + form(urn: String!): Form + """ Fetch a Role by primary key (urn) """ diff --git a/datahub-web-react/src/App.tsx b/datahub-web-react/src/App.tsx index 5be31528fe780..2fdd7c8ed6800 100644 --- a/datahub-web-react/src/App.tsx +++ b/datahub-web-react/src/App.tsx @@ -1,6 +1,5 @@ import React from 'react'; import Cookies from 'js-cookie'; -import { message } from 'antd'; import { BrowserRouter as Router } from 'react-router-dom'; import { ApolloClient, ApolloProvider, createHttpLink, InMemoryCache, ServerError } from '@apollo/client'; import { onError } from '@apollo/client/link/error'; @@ -21,7 +20,7 @@ import { useCustomTheme } from './customThemeContext'; const httpLink = createHttpLink({ uri: '/api/v2/graphql' }); const errorLink = onError((error) => { - const { networkError, graphQLErrors } = error; + const { networkError } = error; if (networkError) { const serverError = networkError as ServerError; if (serverError.statusCode === ErrorCodes.Unauthorized) { @@ -31,13 +30,14 @@ const errorLink = onError((error) => { window.location.replace(`${PageRoutes.AUTHENTICATE}?redirect_uri=${encodeURIComponent(currentPath)}`); } } - if (graphQLErrors && graphQLErrors.length) { - const firstError = graphQLErrors[0]; - const { extensions } = firstError; - const errorCode = extensions && (extensions.code as number); - // Fallback in case the calling component does not handle. - message.error(`${firstError.message} (code ${errorCode})`, 3); - } + // Disabled behavior for now -> Components are expected to handle their errors. + // if (graphQLErrors && graphQLErrors.length) { + // const firstError = graphQLErrors[0]; + // const { extensions } = firstError; + // const errorCode = extensions && (extensions.code as number); + // // Fallback in case the calling component does not handle. + // message.error(`${firstError.message} (code ${errorCode})`, 3); // TODO: Decide if we want this back. + // } }); const client = new ApolloClient({ diff --git a/datahub-web-react/src/graphql/view.graphql b/datahub-web-react/src/graphql/view.graphql index 9d38a09b8280b..f7b82a1e46f04 100644 --- a/datahub-web-react/src/graphql/view.graphql +++ b/datahub-web-react/src/graphql/view.graphql @@ -39,6 +39,12 @@ query listGlobalViews($start: Int!, $count: Int!, $query: String) { } } +query getView($urn: String!) { + view(urn: $urn) { + ...view + } +} + mutation createView($input: CreateViewInput!) { createView(input: $input) { ...view