Skip to content

Commit

Permalink
docs: fix typos and code examples (#11455)
Browse files Browse the repository at this point in the history
Co-authored-by: Lenz Weber-Tronic <[email protected]>
  • Loading branch information
illyakurochkin and phryneas authored Jan 3, 2024
1 parent 988f574 commit eb2cfee
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/source/data/fragments.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ import { ApolloClient, gql, InMemoryCache } from "@apollo/client";
import { createFragmentRegistry } from "@apollo/client/cache";

const client = new ApolloClient({
uri: "http://localhost:4000/graphql"
uri: "http://localhost:4000/graphql",
cache: new InMemoryCache({
fragments: createFragmentRegistry(gql`
fragment ItemFragment on Item {
Expand Down Expand Up @@ -148,7 +148,7 @@ import { ApolloClient, gql, InMemoryCache } from "@apollo/client";
import { createFragmentRegistry } from "@apollo/client/cache";

const client = new ApolloClient({
uri: "http://localhost:4000/graphql"
uri: "http://localhost:4000/graphql",
cache: new InMemoryCache({
fragments: createFragmentRegistry(gql`
fragment ItemFragment on Item {
Expand Down
3 changes: 2 additions & 1 deletion docs/source/data/suspense.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const GET_DOG_QUERY: TypedDocumentNode<Data, Variables> = gql`
# properly cached.
id
name
breed
}
}
`;
Expand Down Expand Up @@ -121,7 +122,7 @@ function App() {
onChange={(e) => setSelectedDog(e.target.value)}
>
{data.dogs.map(({ id, name }) => (
<option key={id} value={id}>{dog.name}</option>
<option key={id} value={id}>{name}</option>
))}
</select>
<Suspense fallback={<div>Loading...</div>}>
Expand Down
2 changes: 1 addition & 1 deletion docs/source/development-testing/reducing-bundle-size.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Reducing bundle size
description: Squeeze those last few bytes out of your production build
---

Two quick configuration changes can help your reduce your bundle size: turning off Apollo Client's development mode and picking a consistent style for your imports.
Two quick configuration changes can help you reduce your bundle size: turning off Apollo Client's development mode and picking a consistent style for your imports.
Every byte counts in optimizing your app's performance.

## Turning off development mode
Expand Down
2 changes: 1 addition & 1 deletion docs/source/performance/babel.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To avoid this runtime overhead, you can precompile your queries created with `gr

1. Using [babel-plugin-graphql-tag](#using-babel-plugin-graphql-tag)
2. Using [graphql-tag.macro](#using-graphql-tagmacro)
1. Using [ts-transform-graphql-tag](#using-ts-transform-graphql-tag) for Typescript
1. Using [ts-transform-graphql-tag](#using-ts-transform-graphql-tag) for TypeScript

If you prefer to keep your GraphQL code in separate files (`.graphql` or `.gql`) you can use [babel-plugin-import-graphql](https://github.com/detrohutt/babel-plugin-import-graphql). This plugin still uses `graphql-tag` under the hood, but transparently. You simply `import` your operations/fragments as if each were an export from your GraphQL file. This carries the same precompilation benefits as the above approaches.

Expand Down
2 changes: 1 addition & 1 deletion src/react/hoc/__tests__/shared-operations.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe("shared operations", () => {
people: DataValue<PeopleData>;
}

// Since we want to test decorators usage, and this does not play well with Typescript,
// Since we want to test decorators usage, and this does not play well with TypeScript,
// we resort to setting everything as any to avoid type checking.
const withPeople: any = graphql<{}, PeopleData, {}, PeopleChildProps>(
peopleQuery,
Expand Down

0 comments on commit eb2cfee

Please sign in to comment.