Skip to content

Commit 67780e4

Browse files
committed
Remove .description, add graphql-js
1 parent 27100e9 commit 67780e4

File tree

4 files changed

+32
-21
lines changed

4 files changed

+32
-21
lines changed

src/components/code-blocks/describe-your-data.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
type Project {
33
name: String
44
tagline: String
5-
contributors: [User]
5+
contributors: [User!]
66
}
77
```

src/components/code-blocks/index.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { clsx } from "clsx"
44

55
import { Pre } from "@/components/pre"
66

7-
import _CodeA from "./describe-your-data.mdx"
8-
import _CodeB from "./ask-for-what-you-want.mdx"
9-
import _CodeC from "./get-predictable-results.mdx"
7+
import DescribeYourData from "./describe-your-data.mdx"
8+
import AskForWhatYouWant from "./ask-for-what-you-want.mdx"
9+
import GetPredictableResults from "./get-predictable-results.mdx"
1010

1111
import _Code1 from "./code1.mdx"
1212
import _Code2 from "./code2.mdx"
@@ -48,9 +48,15 @@ export const Code2 = () => <_Code2 components={components} />
4848
export const Code3 = () => <_Code3 components={components} />
4949
export const Code4 = () => <_Code4 components={components} />
5050

51-
export const CodeA = () => <_CodeA components={components} />
52-
export const CodeB = () => <_CodeB components={components} />
53-
export const CodeC = () => <_CodeC components={components} />
51+
export const HowItWorks_Schema = () => (
52+
<DescribeYourData components={components} />
53+
)
54+
export const HowItWorks_Query = () => (
55+
<AskForWhatYouWant components={components} />
56+
)
57+
export const HowItWorks_Result = () => (
58+
<GetPredictableResults components={components} />
59+
)
5460

5561
export const QueryHeroFriends = () => (
5662
<_QueryHeroFriends components={components} />

src/components/index-page/how-it-works/index.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ import dynamic from "next/dynamic"
44

55
import { Button } from "@/app/conf/_design-system/button"
66
import { SectionLabel } from "@/app/conf/_design-system/section-label"
7-
import { CodeA, CodeB, CodeC } from "@/components/code-blocks"
7+
import {
8+
HowItWorks_Schema,
9+
HowItWorks_Query,
10+
HowItWorks_Result,
11+
} from "@/components/code-blocks"
812

913
import { HowItWorksListItem } from "./how-it-works-list-item"
1014
import { PlayButton } from "./play-button"
@@ -32,13 +36,19 @@ export function HowItWorks() {
3236
<h2 className="typography-h2 mb-6 lg:mb-16">A GraphQL Query</h2>
3337
<div className="relative">
3438
<ol className="gql-radial-gradient list-none gap-px max-md:bg-gradient-to-r max-md:from-transparent max-md:via-neu-400 max-md:to-transparent lg:grid lg:grid-cols-3">
35-
<HowItWorksListItem text="Describe your data" code={<CodeA />} />
39+
<HowItWorksListItem
40+
text="Describe your data"
41+
code={<HowItWorks_Schema />}
42+
/>
3643
<HowItWorksListItem
3744
text="Ask for what you want"
3845
icon={<PlayButton disabled={inView} />}
39-
code={<CodeB />}
46+
code={<HowItWorks_Query />}
47+
/>
48+
<HowItWorksListItem
49+
text="Get predictable results"
50+
code={<HowItWorks_Result />}
4051
/>
41-
<HowItWorksListItem text="Get predictable results" code={<CodeC />} />
4252
</ol>
4353
{inView && (
4454
<ol

src/components/index-page/how-it-works/schema.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import {
88

99
const PROJECT_NAME = "GraphQL"
1010
const PROJECT_TAGLINE = "A query language for APIs"
11-
const PROJECT_DESCRIPTION =
12-
"GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data."
1311
const PROJECT_WEBSITE = "https://graphql.org"
1412

1513
export const INITIAL_QUERY_TEXT = `{
@@ -27,24 +25,25 @@ export const INITIAL_RESULTS_TEXT = `{
2725
interface Project {
2826
name: string
2927
tagline: string
30-
description: string
3128
website: string
3229
}
3330

3431
const projects: Project[] = [
3532
{
3633
name: PROJECT_NAME,
3734
tagline: PROJECT_TAGLINE,
38-
description: PROJECT_DESCRIPTION,
3935
website: PROJECT_WEBSITE,
4036
},
4137
{
4238
name: "GraphiQL",
4339
tagline: "Ecosystem for building browser & IDE tools.",
44-
description:
45-
"GraphiQL is the reference implementation of this monorepo, GraphQL IDE, an official project under the GraphQL Foundation. The code uses the permissive MIT license.",
4640
website: "https://github.com/graphql/graphiql",
4741
},
42+
{
43+
name: "graphql-js",
44+
tagline: "A reference implementation of GraphQL for JavaScript",
45+
website: "https://graphql.org/graphql-js/",
46+
},
4847
]
4948

5049
const ProjectType = new GraphQLObjectType<Project>({
@@ -58,10 +57,6 @@ const ProjectType = new GraphQLObjectType<Project>({
5857
type: GraphQLString,
5958
description: "A short description of what the project does",
6059
},
61-
description: {
62-
type: GraphQLString,
63-
description: "A detailed description of the project",
64-
},
6560
website: {
6661
type: GraphQLString,
6762
description: "The project website URL",

0 commit comments

Comments
 (0)