Skip to content

Commit c5d8a45

Browse files
committed
move function to bottom of files, remove Nexus
1 parent c63c991 commit c5d8a45

File tree

3 files changed

+36
-44
lines changed

3 files changed

+36
-44
lines changed

packages/gatsby-theme/gatsby-node.js

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,6 @@ const {
66

77
const { createApolloFetch } = require('apollo-fetch');
88

9-
const createPrismaNodes = async variables => {
10-
const uri =
11-
'https://howtographql-prod_howtographql-internal.prisma.sh/howtographql/dev';
12-
const apolloFetch = createApolloFetch({ uri });
13-
const query = `
14-
mutation upsertTutorial(
15-
$gatsbyID: String!
16-
$name: String!
17-
$numberofChapters: Int!
18-
) {
19-
upsertTutorial(
20-
where: { gatsbyID: $gatsbyID }
21-
create: {
22-
gatsbyID: $gatsbyID
23-
name: $name
24-
numberofChapters: $numberofChapters
25-
}
26-
update: {
27-
gatsbyID: $gatsbyID
28-
name: $name
29-
numberofChapters: $numberofChapters
30-
}
31-
) {
32-
id
33-
}
34-
}
35-
`;
36-
return apolloFetch({ query, variables })
37-
.then(response => {
38-
console.log(response);
39-
})
40-
.catch(error => {
41-
console.log(error);
42-
});
43-
};
44-
459
exports.createPages = async ({ graphql, actions }) => {
4610
const { createPage } = actions;
4711
const TutorialLayout = require.resolve(
@@ -112,6 +76,42 @@ exports.createPages = async ({ graphql, actions }) => {
11276
});
11377
};
11478

79+
const createPrismaNodes = async variables => {
80+
const uri =
81+
'https://howtographql-prod_howtographql-internal.prisma.sh/howtographql/dev';
82+
const apolloFetch = createApolloFetch({ uri });
83+
const query = `
84+
mutation upsertTutorial(
85+
$gatsbyID: String!
86+
$name: String!
87+
$numberofChapters: Int!
88+
) {
89+
upsertTutorial(
90+
where: { gatsbyID: $gatsbyID }
91+
create: {
92+
gatsbyID: $gatsbyID
93+
name: $name
94+
numberofChapters: $numberofChapters
95+
}
96+
update: {
97+
gatsbyID: $gatsbyID
98+
name: $name
99+
numberofChapters: $numberofChapters
100+
}
101+
) {
102+
id
103+
}
104+
}
105+
`;
106+
return apolloFetch({ query, variables })
107+
.then(response => {
108+
console.log(response);
109+
})
110+
.catch(error => {
111+
console.log(error);
112+
});
113+
};
114+
115115
// overviewpages = overviewpages
116116
// .filter(p => p !== overviewPageSlug)
117117
// .concat([overviewPageSlug]);

packages/server/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"dependencies": {
1414
"isomorphic-fetch": "^2.2.1",
1515
"jsonwebtoken": "^8.5.1",
16-
"nexus": "^0.11.7",
1716
"yoga": "^0.0.20"
1817
},
1918
"devDependencies": {

yarn.lock

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9830,13 +9830,6 @@ [email protected]:
98309830
dependencies:
98319831
tslib "^1.9.3"
98329832

9833-
nexus@^0.11.7:
9834-
version "0.11.7"
9835-
resolved "https://registry.yarnpkg.com/nexus/-/nexus-0.11.7.tgz#db580f1d6feb5e590fe395d9cd218c969c46b9ed"
9836-
integrity sha512-d5iD9jKn8n8tfFerisxYmKlrJmj5omPS49+s1xv2O2q5GiagDH4ySxajg0vsf0EMT2K+OvlCuSxT0xarS1gqKw==
9837-
dependencies:
9838-
tslib "^1.9.3"
9839-
98409833
nice-try@^1.0.4:
98419834
version "1.0.5"
98429835
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366"

0 commit comments

Comments
 (0)