diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index d371b0a7d02..5096ca54451 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -81,7 +81,7 @@ "multiparty": "^4.2.1", "netlify": "^12.0.0", "netlify-headers-parser": "^6.0.2", - "netlify-onegraph-internal": "0.3.9", + "netlify-onegraph-internal": "0.3.10", "netlify-redirect-parser": "^13.0.5", "netlify-redirector": "^0.2.1", "node-fetch": "^2.6.0", @@ -16068,9 +16068,9 @@ } }, "node_modules/netlify-onegraph-internal": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/netlify-onegraph-internal/-/netlify-onegraph-internal-0.3.9.tgz", - "integrity": "sha512-xjyJb6C20xrjr+RwIBFzr4c1ZhRsS4L6nMfsRkimzsBf3RA7b8yE0WZAzrxleBw1tuKFnWMy3B/+IF9r/Z6zXg==", + "version": "0.3.10", + "resolved": "https://registry.npmjs.org/netlify-onegraph-internal/-/netlify-onegraph-internal-0.3.10.tgz", + "integrity": "sha512-8GeKcWbYPV3CCMJEj2LwkhP0eFCDDrt3XDTZuweWHAa5DTkRd6cSEnnH0BjTBBetoFfPKXDjbFmSiD9xobcnPA==", "dependencies": { "graphql": "16.0.0", "node-fetch": "^2.6.0", @@ -34757,9 +34757,9 @@ } }, "netlify-onegraph-internal": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/netlify-onegraph-internal/-/netlify-onegraph-internal-0.3.9.tgz", - "integrity": "sha512-xjyJb6C20xrjr+RwIBFzr4c1ZhRsS4L6nMfsRkimzsBf3RA7b8yE0WZAzrxleBw1tuKFnWMy3B/+IF9r/Z6zXg==", + "version": "0.3.10", + "resolved": "https://registry.npmjs.org/netlify-onegraph-internal/-/netlify-onegraph-internal-0.3.10.tgz", + "integrity": "sha512-8GeKcWbYPV3CCMJEj2LwkhP0eFCDDrt3XDTZuweWHAa5DTkRd6cSEnnH0BjTBBetoFfPKXDjbFmSiD9xobcnPA==", "requires": { "graphql": "16.0.0", "node-fetch": "^2.6.0", diff --git a/package.json b/package.json index 9499bb28b12..28231f69130 100644 --- a/package.json +++ b/package.json @@ -290,7 +290,7 @@ "multiparty": "^4.2.1", "netlify": "^12.0.0", "netlify-headers-parser": "^6.0.2", - "netlify-onegraph-internal": "0.3.9", + "netlify-onegraph-internal": "0.3.10", "netlify-redirect-parser": "^13.0.5", "netlify-redirector": "^0.2.1", "node-fetch": "^2.6.0", diff --git a/src/commands/graph/graph-pull.js b/src/commands/graph/graph-pull.js index 97097fcefc8..093aad56689 100644 --- a/src/commands/graph/graph-pull.js +++ b/src/commands/graph/graph-pull.js @@ -33,9 +33,15 @@ const graphPull = async (options, command) => { const { jwt } = await OneGraphCliClient.getGraphJwtForSite({ siteId, nfToken: netlifyToken }) - await refetchAndGenerateFromOneGraph({ logger: log, netlifyGraphConfig, jwt, state, siteId }) - const oneGraphSessionId = loadCLISession(state) + await refetchAndGenerateFromOneGraph({ + logger: log, + netlifyGraphConfig, + jwt, + state, + siteId, + sessionId: oneGraphSessionId, + }) if (!oneGraphSessionId) { warn( diff --git a/tests/integration/snapshots/530.graph-codegen.test.js.md b/tests/integration/snapshots/530.graph-codegen.test.js.md index e94b7b17885..302c2b83fd0 100644 --- a/tests/integration/snapshots/530.graph-codegen.test.js.md +++ b/tests/integration/snapshots/530.graph-codegen.test.js.md @@ -2664,24 +2664,24 @@ Generated by [AVA](https://avajs.dev). method: 'POST',␊ headers: headers,␊ timeout: timeoutMs,␊ - body: reqBody␊ + body: reqBody,␊ };␊ ␊ const url = 'https://graph.netlify.com/graphql?app_id=' + siteId;␊ ␊ - return fetch(url, reqOptions).then(r => {␊ - body.text().then(bodyString => {␊ + return fetch(url, reqOptions).then((body) => {␊ + return body.text().then((bodyString) => {␊ const headers = {};␊ - r.headers.forEach((k,v) => x[k] = v);␊ - ␊ + body.headers.forEach((k, v) => (headers[k] = v));␊ + ␊ return {␊ body: bodyString,␊ headers: headers,␊ - status: r.status␊ - }␊ - })␊ + status: body.status,␊ + };␊ + });␊ });␊ - }␊ + };␊ ␊ const fetchNetlifyGraph = function fetchNetlifyGraph(input) {␊ const query = input.query;␊ @@ -7541,24 +7541,24 @@ Generated by [AVA](https://avajs.dev). method: 'POST',␊ headers: headers,␊ timeout: timeoutMs,␊ - body: reqBody␊ + body: reqBody,␊ };␊ ␊ const url = 'https://graph.netlify.com/graphql?app_id=' + siteId;␊ ␊ - return fetch(url, reqOptions).then(r => {␊ - body.text().then(bodyString => {␊ + return fetch(url, reqOptions).then((body) => {␊ + return body.text().then((bodyString) => {␊ const headers = {};␊ - r.headers.forEach((k,v) => x[k] = v);␊ - ␊ + body.headers.forEach((k, v) => (headers[k] = v));␊ + ␊ return {␊ body: bodyString,␊ headers: headers,␊ - status: r.status␊ - }␊ - })␊ + status: body.status,␊ + };␊ + });␊ });␊ - }␊ + };␊ ␊ const fetchNetlifyGraph = function fetchNetlifyGraph(input) {␊ const query = input.query;␊ @@ -12418,24 +12418,24 @@ Generated by [AVA](https://avajs.dev). method: 'POST',␊ headers: headers,␊ timeout: timeoutMs,␊ - body: reqBody␊ + body: reqBody,␊ };␊ ␊ const url = 'https://graph.netlify.com/graphql?app_id=' + siteId;␊ ␊ - return fetch(url, reqOptions).then(r => {␊ - body.text().then(bodyString => {␊ + return fetch(url, reqOptions).then((body) => {␊ + return body.text().then((bodyString) => {␊ const headers = {};␊ - r.headers.forEach((k,v) => x[k] = v);␊ - ␊ + body.headers.forEach((k, v) => (headers[k] = v));␊ + ␊ return {␊ body: bodyString,␊ headers: headers,␊ - status: r.status␊ - }␊ - })␊ + status: body.status,␊ + };␊ + });␊ });␊ - }␊ + };␊ ␊ const fetchNetlifyGraph = function fetchNetlifyGraph(input) {␊ const query = input.query;␊ @@ -17295,24 +17295,24 @@ Generated by [AVA](https://avajs.dev). method: 'POST',␊ headers: headers,␊ timeout: timeoutMs,␊ - body: reqBody␊ + body: reqBody,␊ };␊ ␊ const url = 'https://graph.netlify.com/graphql?app_id=' + siteId;␊ ␊ - return fetch(url, reqOptions).then(r => {␊ - body.text().then(bodyString => {␊ + return fetch(url, reqOptions).then((body) => {␊ + return body.text().then((bodyString) => {␊ const headers = {};␊ - r.headers.forEach((k,v) => x[k] = v);␊ - ␊ + body.headers.forEach((k, v) => (headers[k] = v));␊ + ␊ return {␊ body: bodyString,␊ headers: headers,␊ - status: r.status␊ - }␊ - })␊ + status: body.status,␊ + };␊ + });␊ });␊ - }␊ + };␊ ␊ const fetchNetlifyGraph = function fetchNetlifyGraph(input) {␊ const query = input.query;␊ @@ -22172,24 +22172,24 @@ Generated by [AVA](https://avajs.dev). method: 'POST',␊ headers: headers,␊ timeout: timeoutMs,␊ - body: reqBody␊ + body: reqBody,␊ };␊ ␊ const url = 'https://graph.netlify.com/graphql?app_id=' + siteId;␊ ␊ - return fetch(url, reqOptions).then(r => {␊ - body.text().then(bodyString => {␊ + return fetch(url, reqOptions).then((body) => {␊ + return body.text().then((bodyString) => {␊ const headers = {};␊ - r.headers.forEach((k,v) => x[k] = v);␊ - ␊ + body.headers.forEach((k, v) => (headers[k] = v));␊ + ␊ return {␊ body: bodyString,␊ headers: headers,␊ - status: r.status␊ - }␊ - })␊ + status: body.status,␊ + };␊ + });␊ });␊ - }␊ + };␊ ␊ const fetchNetlifyGraph = function fetchNetlifyGraph(input) {␊ const query = input.query;␊ @@ -27049,24 +27049,24 @@ Generated by [AVA](https://avajs.dev). method: 'POST',␊ headers: headers,␊ timeout: timeoutMs,␊ - body: reqBody␊ + body: reqBody,␊ };␊ ␊ const url = 'https://graph.netlify.com/graphql?app_id=' + siteId;␊ ␊ - return fetch(url, reqOptions).then(r => {␊ - body.text().then(bodyString => {␊ + return fetch(url, reqOptions).then((body) => {␊ + return body.text().then((bodyString) => {␊ const headers = {};␊ - r.headers.forEach((k,v) => x[k] = v);␊ - ␊ + body.headers.forEach((k, v) => (headers[k] = v));␊ + ␊ return {␊ body: bodyString,␊ headers: headers,␊ - status: r.status␊ - }␊ - })␊ + status: body.status,␊ + };␊ + });␊ });␊ - }␊ + };␊ ␊ const fetchNetlifyGraph = function fetchNetlifyGraph(input) {␊ const query = input.query;␊ @@ -31926,24 +31926,24 @@ Generated by [AVA](https://avajs.dev). method: 'POST',␊ headers: headers,␊ timeout: timeoutMs,␊ - body: reqBody␊ + body: reqBody,␊ };␊ ␊ const url = 'https://graph.netlify.com/graphql?app_id=' + siteId;␊ ␊ - return fetch(url, reqOptions).then(r => {␊ - body.text().then(bodyString => {␊ + return fetch(url, reqOptions).then((body) => {␊ + return body.text().then((bodyString) => {␊ const headers = {};␊ - r.headers.forEach((k,v) => x[k] = v);␊ - ␊ + body.headers.forEach((k, v) => (headers[k] = v));␊ + ␊ return {␊ body: bodyString,␊ headers: headers,␊ - status: r.status␊ - }␊ - })␊ + status: body.status,␊ + };␊ + });␊ });␊ - }␊ + };␊ ␊ const fetchNetlifyGraph = function fetchNetlifyGraph(input) {␊ const query = input.query;␊ @@ -36803,24 +36803,24 @@ Generated by [AVA](https://avajs.dev). method: 'POST',␊ headers: headers,␊ timeout: timeoutMs,␊ - body: reqBody␊ + body: reqBody,␊ };␊ ␊ const url = 'https://graph.netlify.com/graphql?app_id=' + siteId;␊ ␊ - return fetch(url, reqOptions).then(r => {␊ - body.text().then(bodyString => {␊ + return fetch(url, reqOptions).then((body) => {␊ + return body.text().then((bodyString) => {␊ const headers = {};␊ - r.headers.forEach((k,v) => x[k] = v);␊ - ␊ + body.headers.forEach((k, v) => (headers[k] = v));␊ + ␊ return {␊ body: bodyString,␊ headers: headers,␊ - status: r.status␊ - }␊ - })␊ + status: body.status,␊ + };␊ + });␊ });␊ - }␊ + };␊ ␊ const fetchNetlifyGraph = function fetchNetlifyGraph(input) {␊ const query = input.query;␊ diff --git a/tests/integration/snapshots/530.graph-codegen.test.js.snap b/tests/integration/snapshots/530.graph-codegen.test.js.snap index 795f91c8b3f..3b02caa4482 100644 Binary files a/tests/integration/snapshots/530.graph-codegen.test.js.snap and b/tests/integration/snapshots/530.graph-codegen.test.js.snap differ