@graphcommerce/hygraph-cli 10.0.0-canary.68 → 10.0.0-canary.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @graphcommerce/hygraph-cli
2
2
 
3
+ ## 10.0.0-canary.72
4
+
5
+ ## 10.0.0-canary.71
6
+
7
+ ## 10.0.0-canary.70
8
+
9
+ ### Major Changes
10
+
11
+ - [#2565](https://github.com/graphcommerce-org/graphcommerce/pull/2565) [`c96dfcd`](https://github.com/graphcommerce-org/graphcommerce/commit/c96dfcdca981baca387c270ad9e2b9515cdd00cc) - Updated to Apollo Client 4 ([@paales](https://github.com/paales))
12
+
13
+ ## 10.0.0-canary.69
14
+
3
15
  ## 10.0.0-canary.68
4
16
 
5
17
  ## 10.0.0-canary.67
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ import prompts from 'prompts';
5
5
  import { SimpleFieldType, VisibilityTypes, RelationalFieldType, Client } from '@hygraph/management-sdk';
6
6
  import { gql, ApolloClient, InMemoryCache, HttpLink } from '@apollo/client';
7
7
  import gql$1 from 'graphql-tag';
8
+ import { LocalState } from '@apollo/client/local-state';
8
9
 
9
10
  const capitalize = (word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
10
11
  const graphcommerceLog = (message, type) => {
@@ -844,7 +845,8 @@ function getManagementClient(config) {
844
845
  fetch,
845
846
  headers: { Authorization: `Bearer ${accessToken}` }
846
847
  }),
847
- cache: new InMemoryCache()
848
+ cache: new InMemoryCache(),
849
+ localState: new LocalState({})
848
850
  });
849
851
  }
850
852
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/hygraph-cli",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "10.0.0-canary.68",
5
+ "version": "10.0.0-canary.72",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {
@@ -18,17 +18,17 @@
18
18
  "dependencies": {
19
19
  "@hygraph/management-sdk": "1.5.2",
20
20
  "@types/prompts": "^2.4.9",
21
- "@whatwg-node/fetch": "^0.10.10",
21
+ "@whatwg-node/fetch": "^0.10.13",
22
22
  "graphql": "^16.12.0",
23
23
  "graphql-tag": "^2.12.6",
24
24
  "prompts": "^2.4.2"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@apollo/client": "*",
28
- "@graphcommerce/eslint-config-pwa": "^10.0.0-canary.68",
29
- "@graphcommerce/next-config": "^10.0.0-canary.68",
30
- "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.68",
31
- "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.68",
28
+ "@graphcommerce/eslint-config-pwa": "^10.0.0-canary.72",
29
+ "@graphcommerce/next-config": "^10.0.0-canary.72",
30
+ "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.72",
31
+ "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.72",
32
32
  "dotenv": "^16.1.4"
33
33
  },
34
34
  "devDependencies": {
package/src/readSchema.ts CHANGED
@@ -2,10 +2,7 @@ import type { ApolloClient, NormalizedCacheObject } from '@apollo/client'
2
2
  import { gql } from '@apollo/client'
3
3
  import type { Schema } from './types'
4
4
 
5
- export const readSchema = async (
6
- managementClient: ApolloClient<NormalizedCacheObject>,
7
- projectId: string,
8
- ) => {
5
+ export const readSchema = async (managementClient: ApolloClient, projectId: string) => {
9
6
  const { data } = await managementClient.query({
10
7
  query: gql`
11
8
  query getSchema($projectId: ID!) {
@@ -2,10 +2,7 @@ import type { ApolloClient, NormalizedCacheObject } from '@apollo/client'
2
2
  import gql from 'graphql-tag'
3
3
  import type { HygraphConfig } from './getConfig'
4
4
 
5
- export async function getEnvironment(
6
- client: ApolloClient<NormalizedCacheObject>,
7
- config: HygraphConfig,
8
- ) {
5
+ export async function getEnvironment(client: ApolloClient, config: HygraphConfig) {
9
6
  const endpoints = await client.query<
10
7
  {
11
8
  viewer: {
@@ -1,4 +1,5 @@
1
1
  import { ApolloClient, HttpLink, InMemoryCache } from '@apollo/client'
2
+ import { LocalState } from '@apollo/client/local-state'
2
3
  import type { HygraphConfig } from './getConfig'
3
4
 
4
5
  export function getManagementClient(config: HygraphConfig) {
@@ -10,6 +11,8 @@ export function getManagementClient(config: HygraphConfig) {
10
11
  fetch,
11
12
  headers: { Authorization: `Bearer ${accessToken}` },
12
13
  }),
14
+
13
15
  cache: new InMemoryCache(),
16
+ localState: new LocalState({}),
14
17
  })
15
18
  }