Skip to content

Commit 7bd3e90

Browse files
chore(prettier): 🤖 ✨
1 parent b77309f commit 7bd3e90

File tree

7 files changed

+944
-300
lines changed

7 files changed

+944
-300
lines changed

‎examples/cdrs/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
This is a test Gatsby app for end-to-end testing the gatsby-source-sanity plugin with Sanity Content Lake data and schema
22

33
# Testing
4+
45
Manually run the application
56

67
```bash

‎examples/cdrs/package.json‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
11
{
22
"name": "cdrs",
3+
"version": "0.1.0",
34
"private": true,
45
"description": "A simple starter to get up and developing quickly with Gatsby",
5-
"version": "0.1.0",
6+
"keywords": [
7+
"gatsby"
8+
],
9+
"bugs": {
10+
"url": "https://github.com/gatsbyjs/gatsby/issues"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "https://github.com/gatsbyjs/gatsby-starter-default"
15+
},
16+
"license": "0BSD",
617
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
18+
"scripts": {
19+
"build": "gatsby build",
20+
"clean": "gatsby clean",
21+
"develop": "gatsby develop",
22+
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md,css}\"",
23+
"serve": "gatsby serve",
24+
"start": "gatsby develop",
25+
"test": "jest"
26+
},
727
"dependencies": {
828
"gatsby": "^5.12.4",
929
"gatsby-plugin-image": "^3.12.0",
@@ -20,25 +40,5 @@
2040
"identity-obj-proxy": "^3.0.0",
2141
"jest": "^29.7.0",
2242
"prettier": "^2.8.8"
23-
},
24-
"keywords": [
25-
"gatsby"
26-
],
27-
"license": "0BSD",
28-
"scripts": {
29-
"build": "gatsby build",
30-
"develop": "gatsby develop",
31-
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md,css}\"",
32-
"start": "gatsby develop",
33-
"serve": "gatsby serve",
34-
"clean": "gatsby clean",
35-
"test": "jest"
36-
},
37-
"repository": {
38-
"type": "git",
39-
"url": "https://github.com/gatsbyjs/gatsby-starter-default"
40-
},
41-
"bugs": {
42-
"url": "https://github.com/gatsbyjs/gatsby/issues"
4343
}
4444
}

‎examples/cdrs/test/graphqlReferences.test.js‎

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
const {assert} = require('console')
1+
const { assert } = require("console")
22

33
beforeAll(async () => {
44
// Test if Gatsby server is running
5-
const response = await fetch('http://localhost:8000/___graphql')
5+
const response = await fetch("http://localhost:8000/___graphql")
66
if (response.status !== 200) {
7-
throw new Error('Gatsby server is not running.')
7+
throw new Error("Gatsby server is not running.")
88
}
99
})
1010

1111
async function fetchGraphQL(query, variables) {
12-
return fetch('http://localhost:8000/___graphql', {
13-
method: 'POST',
12+
return fetch("http://localhost:8000/___graphql", {
13+
method: "POST",
1414
headers: {
15-
'Content-Type': 'application/json',
15+
"Content-Type": "application/json",
1616
},
1717
body: JSON.stringify({
1818
query,
1919
variables,
2020
}),
21-
}).then((res) => {
21+
}).then(res => {
2222
return res.json()
2323
})
2424
}
2525

26-
test('resolves regular field reference', async () => {
26+
test("resolves regular field reference", async () => {
2727
const res = await fetchGraphQL(`
2828
query {
2929
allSanityBook {
@@ -40,10 +40,10 @@ test('resolves regular field reference', async () => {
4040

4141
expect(res.errors).toBeUndefined()
4242
const node = res.data.allSanityBook.edges[0].node
43-
expect(node.publisher.name).toBe('Bantam Books')
43+
expect(node.publisher.name).toBe("Bantam Books")
4444
})
4545

46-
test('resolves inline cross dataset field reference', async () => {
46+
test("resolves inline cross dataset field reference", async () => {
4747
const res = await fetchGraphQL(`
4848
query {
4949
allSanityBook {
@@ -60,7 +60,7 @@ test('resolves inline cross dataset field reference', async () => {
6060

6161
expect(res.errors).toBeUndefined()
6262
const node = res.data.allSanityBook.edges[0].node
63-
expect(node.author.name).toBe('Neal Stephenson')
63+
expect(node.author.name).toBe("Neal Stephenson")
6464
})
6565

6666
test('resolves inline cross dataset field reference that has multiple "to" types', async () => {
@@ -85,10 +85,10 @@ test('resolves inline cross dataset field reference that has multiple "to" types
8585

8686
expect(res.errors).toBeUndefined()
8787
const node = res.data.allSanityBook.edges[0].node
88-
expect(node.authorOrEditorInline.name).toBe('Mrs Book Editor')
88+
expect(node.authorOrEditorInline.name).toBe("Mrs Book Editor")
8989
})
9090

91-
test('resolves named cross dataset field reference', async () => {
91+
test("resolves named cross dataset field reference", async () => {
9292
const res = await fetchGraphQL(`
9393
query {
9494
allSanityBook {
@@ -105,7 +105,7 @@ test('resolves named cross dataset field reference', async () => {
105105

106106
expect(res.errors).toBeUndefined()
107107
const node = res.data.allSanityBook.edges[0].node
108-
expect(node.extraAuthor.name).toBe('Neal Stephenson')
108+
expect(node.extraAuthor.name).toBe("Neal Stephenson")
109109
})
110110

111111
test('resolves named cross dataset field reference with multiple "to" types', async () => {
@@ -130,10 +130,10 @@ test('resolves named cross dataset field reference with multiple "to" types', as
130130

131131
expect(res.errors).toBeUndefined()
132132
const node = res.data.allSanityBook.edges[0].node
133-
expect(node.authorOrEditor.name).toBe('Neal Stephenson')
133+
expect(node.authorOrEditor.name).toBe("Neal Stephenson")
134134
})
135135

136-
test('it resolves arrays of references', async () => {
136+
test("it resolves arrays of references", async () => {
137137
const res = await fetchGraphQL(`
138138
query {
139139
allSanityBook {
@@ -152,17 +152,17 @@ test('it resolves arrays of references', async () => {
152152
const node = res.data.allSanityBook.edges[0].node
153153
const expected = [
154154
{
155-
title: 'Science Fiction',
155+
title: "Science Fiction",
156156
},
157157
{
158-
title: 'Cyberpunk',
158+
title: "Cyberpunk",
159159
},
160160
]
161161

162162
expect(node.genres).toEqual(expected)
163163
})
164164

165-
test('it resolves arrays of cross dataset references', async () => {
165+
test("it resolves arrays of cross dataset references", async () => {
166166
const res = await fetchGraphQL(`
167167
query {
168168
allSanityBook {
@@ -181,17 +181,17 @@ test('it resolves arrays of cross dataset references', async () => {
181181
const node = res.data.allSanityBook.edges[0].node
182182
const expected = [
183183
{
184-
name: 'Nom de Plume',
184+
name: "Nom de Plume",
185185
},
186186
{
187-
name: 'Neal Stephenson',
187+
name: "Neal Stephenson",
188188
},
189189
]
190190

191191
expect(node.coauthors).toEqual(expected)
192192
})
193193

194-
test('it resolves cross dataset references that are part of an Union', async () => {
194+
test("it resolves cross dataset references that are part of an Union", async () => {
195195
const res = await fetchGraphQL(`
196196
query {
197197
allSanityBook {
@@ -212,7 +212,7 @@ test('it resolves cross dataset references that are part of an Union', async ()
212212
const node = res.data.allSanityBook.edges[0].node
213213
const expected = [
214214
{
215-
name: 'Neal Stephenson',
215+
name: "Neal Stephenson",
216216
},
217217
]
218218

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
{
22
"name": "shared-content-studio",
3-
"private": true,
43
"version": "1.0.0",
5-
"main": "package.json",
4+
"private": true,
5+
"keywords": [
6+
"sanity"
7+
],
68
"license": "UNLICENSED",
9+
"main": "package.json",
710
"scripts": {
8-
"dev": "sanity dev",
9-
"start": "sanity start",
1011
"build": "sanity build",
1112
"deploy": "sanity deploy",
12-
"deploy-graphql": "sanity graphql deploy"
13+
"deploy-graphql": "sanity graphql deploy",
14+
"dev": "sanity dev",
15+
"start": "sanity start"
16+
},
17+
"prettier": {
18+
"bracketSpacing": false,
19+
"printWidth": 100,
20+
"semi": false,
21+
"singleQuote": true
1322
},
14-
"keywords": [
15-
"sanity"
16-
],
1723
"dependencies": {
1824
"@sanity/vision": "^3.16.0",
1925
"react": "^18.2.0",
@@ -29,11 +35,5 @@
2935
"eslint": "^8.6.0",
3036
"prettier": "^3.0.2",
3137
"typescript": "^5.1.6"
32-
},
33-
"prettier": {
34-
"semi": false,
35-
"printWidth": 100,
36-
"bracketSpacing": false,
37-
"singleQuote": true
3838
}
3939
}

0 commit comments

Comments
 (0)