Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
fix: remove unused GraphQL calls
Browse files Browse the repository at this point in the history
  • Loading branch information
rot1024 committed Aug 12, 2022
1 parent b7efa72 commit 59f402e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 183 deletions.
4 changes: 1 addition & 3 deletions src/components/organisms/Settings/Project/Plugin/hooks.ts
Expand Up @@ -3,7 +3,6 @@ import { useCallback, useMemo } from "react";

import { PluginItem } from "@reearth/components/molecules/Settings/Project/Plugin/PluginSection";
import {
useGetInstallablePluginsQuery,
useGetInstalledPluginsQuery,
useUninstallPluginMutation,
useUploadPluginMutation,
Expand All @@ -19,7 +18,6 @@ export default (projectId: string) => {
const [currentProject] = useProject();
const [, setNotification] = useNotification();

const { loading: pluginLoading } = useGetInstallablePluginsQuery();
const [uploadPluginMutation] = useUploadPluginMutation();
const [uninstallPluginMutation] = useUninstallPluginMutation();

Expand Down Expand Up @@ -124,7 +122,7 @@ export default (projectId: string) => {
[rawSceneData?.scene?.id, uninstallPluginMutation, setNotification, t, client],
);

const loading = sceneLoading || pluginLoading;
const loading = sceneLoading;
return {
currentTeam,
currentProject,
Expand Down
53 changes: 0 additions & 53 deletions src/gql/graphql-client-api.tsx
Expand Up @@ -1246,15 +1246,6 @@ export enum PluginExtensionType {
Widget = 'WIDGET'
}

export type PluginMetadata = {
__typename?: 'PluginMetadata';
author: Scalars['String'];
createdAt: Scalars['DateTime'];
description: Scalars['String'];
name: Scalars['String'];
thumbnailUrl: Scalars['String'];
};

export type Project = Node & {
__typename?: 'Project';
alias: Scalars['String'];
Expand Down Expand Up @@ -1496,7 +1487,6 @@ export type Query = {
datasetSchemas: DatasetSchemaConnection;
datasets: DatasetConnection;
dynamicDatasetSchemas: Array<DatasetSchema>;
installablePlugins: Array<PluginMetadata>;
layer?: Maybe<Layer>;
me?: Maybe<Me>;
node?: Maybe<Node>;
Expand Down Expand Up @@ -2661,11 +2651,6 @@ export type GetScenePluginsForDatasetInfoPaneQueryVariables = Exact<{

export type GetScenePluginsForDatasetInfoPaneQuery = { __typename?: 'Query', scene?: { __typename?: 'Scene', id: string, plugins: Array<{ __typename?: 'ScenePlugin', pluginId: string, plugin?: { __typename?: 'Plugin', id: string, name: string, extensions: Array<{ __typename?: 'PluginExtension', extensionId: string, type: PluginExtensionType, name: string, description: string, icon: string, translatedName: string }> } | null }> } | null };

export type GetInstallablePluginsQueryVariables = Exact<{ [key: string]: never; }>;


export type GetInstallablePluginsQuery = { __typename?: 'Query', installablePlugins: Array<{ __typename?: 'PluginMetadata', name: string, description: string, thumbnailUrl: string, author: string, createdAt: Date }> };

export type GetInstalledPluginsQueryVariables = Exact<{
projectId: Scalars['ID'];
lang?: InputMaybe<Scalars['Lang']>;
Expand Down Expand Up @@ -5387,44 +5372,6 @@ export function useGetScenePluginsForDatasetInfoPaneLazyQuery(baseOptions?: Apol
export type GetScenePluginsForDatasetInfoPaneQueryHookResult = ReturnType<typeof useGetScenePluginsForDatasetInfoPaneQuery>;
export type GetScenePluginsForDatasetInfoPaneLazyQueryHookResult = ReturnType<typeof useGetScenePluginsForDatasetInfoPaneLazyQuery>;
export type GetScenePluginsForDatasetInfoPaneQueryResult = Apollo.QueryResult<GetScenePluginsForDatasetInfoPaneQuery, GetScenePluginsForDatasetInfoPaneQueryVariables>;
export const GetInstallablePluginsDocument = gql`
query GetInstallablePlugins {
installablePlugins {
name
description
thumbnailUrl
author
createdAt
}
}
`;

/**
* __useGetInstallablePluginsQuery__
*
* To run a query within a React component, call `useGetInstallablePluginsQuery` and pass it any options that fit your needs.
* When your component renders, `useGetInstallablePluginsQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useGetInstallablePluginsQuery({
* variables: {
* },
* });
*/
export function useGetInstallablePluginsQuery(baseOptions?: Apollo.QueryHookOptions<GetInstallablePluginsQuery, GetInstallablePluginsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetInstallablePluginsQuery, GetInstallablePluginsQueryVariables>(GetInstallablePluginsDocument, options);
}
export function useGetInstallablePluginsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetInstallablePluginsQuery, GetInstallablePluginsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<GetInstallablePluginsQuery, GetInstallablePluginsQueryVariables>(GetInstallablePluginsDocument, options);
}
export type GetInstallablePluginsQueryHookResult = ReturnType<typeof useGetInstallablePluginsQuery>;
export type GetInstallablePluginsLazyQueryHookResult = ReturnType<typeof useGetInstallablePluginsLazyQuery>;
export type GetInstallablePluginsQueryResult = Apollo.QueryResult<GetInstallablePluginsQuery, GetInstallablePluginsQueryVariables>;
export const GetInstalledPluginsDocument = gql`
query GetInstalledPlugins($projectId: ID!, $lang: Lang) {
scene(projectId: $projectId) {
Expand Down
115 changes: 0 additions & 115 deletions src/gql/graphql.schema.json
Expand Up @@ -9613,97 +9613,6 @@
],
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "PluginMetadata",
"description": null,
"fields": [
{
"name": "author",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "createdAt",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "DateTime",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "description",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "name",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "thumbnailUrl",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "Project",
Expand Down Expand Up @@ -12154,30 +12063,6 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "installablePlugins",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "PluginMetadata",
"ofType": null
}
}
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "layer",
"description": null,
Expand Down
12 changes: 0 additions & 12 deletions src/gql/queries/plugin.ts
Expand Up @@ -15,18 +15,6 @@ export const GET_SCENE_PLUGINS_FOR_DATASET_INFO_PANE = gql`
}
`;

export const GET_INSTALLABLE_PLUGINS = gql`
query GetInstallablePlugins {
installablePlugins {
name
description
thumbnailUrl
author
createdAt
}
}
`;

export const GET_INSTALLED_PLUGINS = gql`
query GetInstalledPlugins($projectId: ID!, $lang: Lang) {
scene(projectId: $projectId) {
Expand Down

0 comments on commit 59f402e

Please sign in to comment.