Skip to content

Commit

Permalink
consistently use PascalCase query, mutation, subscription name in the…
Browse files Browse the repository at this point in the history
… docs
  • Loading branch information
chentsulin committed Jul 14, 2018
1 parent 60eb1db commit e28f44f
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions docs/source/advanced/caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ mutate({
//... insert comment mutation
refetchQueries: [{
query: gql`
query updateCache($repoName: String!) {
query UpdateCache($repoName: String!) {
entry(repoFullName: $repoName) {
id
comments {
Expand Down Expand Up @@ -306,7 +306,7 @@ Using `update` gives you full control over the cache, allowing you to make chang
import CommentAppQuery from '../queries/CommentAppQuery';

const SUBMIT_COMMENT_MUTATION = gql`
mutation submitComment($repoFullName: String!, $commentContent: String!) {
mutation SubmitComment($repoFullName: String!, $commentContent: String!) {
submitComment(
repoFullName: $repoFullName
commentContent: $commentContent
Expand Down
6 changes: 3 additions & 3 deletions docs/source/advanced/fragments.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fragment NameParts on Person {
lastName
}

query getPerson {
query GetPerson {
people(id: "7") {
...NameParts
avatar(size: LARGE)
Expand Down Expand Up @@ -54,9 +54,9 @@ We put the fragment on `CommentsPage.fragments.comment` by convention, and use t

When it's time to embed the fragment in a query, we simply use the `...Name` syntax in our GraphQL, and embed the fragment inside our query GraphQL document:

```
```js
const SUBMIT_COMMENT_MUTATION = gql`
mutation submitComment($repoFullName: String!, $commentContent: String!) {
mutation SubmitComment($repoFullName: String!, $commentContent: String!) {
submitComment(repoFullName: $repoFullName, commentContent: $commentContent) {
...CommentsPageComment
}
Expand Down
6 changes: 3 additions & 3 deletions docs/source/advanced/update-store.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ mutate({
//... insert comment mutation
refetchQueries: [{
query: gql`
query updateCache($repoName: String!) {
query UpdateCache($repoName: String!) {
entry(repoFullName: $repoName) {
id
comments {
Expand Down Expand Up @@ -135,7 +135,7 @@ Using `update` gives you full control over the cache, allowing you to make chang
import CommentAppQuery from '../queries/CommentAppQuery';

const SUBMIT_COMMENT_MUTATION = gql`
mutation submitComment($repoFullName: String!, $commentContent: String!) {
mutation SubmitComment($repoFullName: String!, $commentContent: String!) {
submitComment(repoFullName: $repoFullName, commentContent: $commentContent) {
postedBy {
login
Expand Down Expand Up @@ -189,7 +189,7 @@ We expose this mutation through a function prop that the `CommentsPage` componen
import update from 'immutability-helper';

const SUBMIT_COMMENT_MUTATION = gql`
mutation submitComment($repoFullName: String!, $commentContent: String!) {
mutation SubmitComment($repoFullName: String!, $commentContent: String!) {
submitComment(repoFullName: $repoFullName, commentContent: $commentContent) {
postedBy {
login
Expand Down
6 changes: 3 additions & 3 deletions docs/source/basics/mutations.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import gql from 'graphql-tag';
class NewEntry extends Component { ... }

const submitRepository = gql`
mutation submitRepository {
mutation SubmitRepository {
submitRepository(repoFullName: "apollographql/apollo-client") {
createdAt
}
Expand Down Expand Up @@ -86,7 +86,7 @@ class NewEntry extends Component {
}

const submitRepository = gql`
mutation submitRepository($repoFullName: String!) {
mutation SubmitRepository($repoFullName: String!) {
submitRepository(repoFullName: $repoFullName) {
createdAt
}
Expand Down Expand Up @@ -194,7 +194,7 @@ import gql from 'graphql-tag';
class CommentPage extends Component { ... }

const submitComment = gql`
mutation submitComment($repoFullName: String!, $commentContent: String!) {
mutation SubmitComment($repoFullName: String!, $commentContent: String!) {
submitComment(repoFullName: $repoFullName, commentContent: $commentContent) {
postedBy {
login
Expand Down
2 changes: 1 addition & 1 deletion docs/source/basics/queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ For queries, the shape of the `data` prop is the following:
There are a lot more methods as well, which you can read about [in the API docs for queries](#graphql-query-data). As an example, for a query like this:

```graphql
query getUserAndLikes($id: ID!) {
query GetUserAndLikes($id: ID!) {
user(userId: $id) { name }
likes(userId: $id) { count }
}
Expand Down
2 changes: 1 addition & 1 deletion docs/source/essentials/local-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ First, let's look at an example of a mixed query. The `images` field comes from

```js
const GET_DOG = gql`
query getDogByBreed($breed: String!) {
query GetDogByBreed($breed: String!) {
dog(breed: $breed) {
images {
url
Expand Down
4 changes: 2 additions & 2 deletions docs/source/essentials/mutations.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import gql from "graphql-tag";
import { Mutation } from "react-apollo";

const ADD_TODO = gql`
mutation addTodo($type: String!) {
mutation AddTodo($type: String!) {
addTodo(type: $type) {
id
type
Expand Down Expand Up @@ -117,7 +117,7 @@ Not every mutation requires an update function. If you're updating a single item

```jsx
const UPDATE_TODO = gql`
mutation updateTodo($id: String!, $type: String!) {
mutation UpdateTodo($id: String!, $type: String!) {
updateTodo(id: $id, type: $type) {
id
type
Expand Down
2 changes: 1 addition & 1 deletion docs/source/essentials/queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ To see Apollo Client's caching in action, let's build our `DogPhoto` component.

```jsx
const GET_DOG_PHOTO = gql`
query dog($breed: String!) {
query Dog($breed: String!) {
dog(breed: $breed) {
id
displayImage
Expand Down
4 changes: 2 additions & 2 deletions docs/source/features/optimistic-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Here's what this looks like in the code:

```js
const UPDATE_COMMENT = gql`
mutation updateComment($commentId: ID!, $commentContent: String!) {
mutation UpdateComment($commentId: ID!, $commentContent: String!) {
updateComment(commentId: $commentId, commentContent: $commentContent) {
id
__typename
Expand Down Expand Up @@ -59,7 +59,7 @@ Here is a concrete example from GitHunt, which inserts a comment into an existin

```js
const SUBMIT_COMMENT_MUTATION = gql`
mutation submitComment($repoFullName: String!, $commentContent: String!) {
mutation SubmitComment($repoFullName: String!, $commentContent: String!) {
submitComment(
repoFullName: $repoFullName
commentContent: $commentContent
Expand Down
10 changes: 5 additions & 5 deletions docs/source/features/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ And you have two Views:

The query for the Series Overview would look like the following:
```graphql
query seriesOverviewData {
query SeriesOverviewData {
series {
id
title
Expand All @@ -186,7 +186,7 @@ query seriesOverviewData {

The queries for the Series DetailView would look like this:
```graphql
query seriesDetailData($seriesId: Int!) {
query SeriesDetailData($seriesId: Int!) {
oneSeries(id: $seriesId) {
id
title
Expand All @@ -197,7 +197,7 @@ query seriesDetailData($seriesId: Int!) {
```

```graphql
query seriesEpisodes($seriesId: Int!) {
query SeriesEpisodes($seriesId: Int!) {
oneSeries(id: $seriesId) {
id
episodes {
Expand Down Expand Up @@ -234,7 +234,7 @@ const client = new ApolloClient({
A component for the second view that implements the two queries could look like this:
```jsx
const QUERY_SERIES_DETAIL_VIEW = gql`
query seriesDetailData($seriesId: Int!) {
query SeriesDetailData($seriesId: Int!) {
oneSeries(id: $seriesId) {
id
title
Expand All @@ -245,7 +245,7 @@ const QUERY_SERIES_DETAIL_VIEW = gql`
`;

const QUERY_SERIES_EPISODES = gql`
query seriesEpisodes($seriesId: Int!) {
query SeriesEpisodes($seriesId: Int!) {
oneSeries(id: $seriesId) {
id
episodes {
Expand Down
2 changes: 1 addition & 1 deletion docs/source/recipes/recompose.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ const withData = compose(
withState("pollInterval", "setPollInterval", DEFAULT_INTERVAL),
graphql(
gql`
query getMigrationStatus {
query GetMigrationStatus {
activeMigration {
name
version
Expand Down
4 changes: 2 additions & 2 deletions docs/source/why-apollo.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const GET_ALL_DOGS = gql`
`;

const UPDATE_DISPLAY_IMAGE = gql`
mutation updateDisplayImage($id: String!, $displayImage: String!) {
mutation UpdateDisplayImage($id: String!, $displayImage: String!) {
updateDisplayImage(id: $id, displayImage: $displayImage) {
id
displayImage
Expand Down Expand Up @@ -102,7 +102,7 @@ Managing all your data with Apollo Client allows you to take advantage of GraphQ

```js
const GET_DOG = gql`
query getDogByBreed($breed: String!) {
query GetDogByBreed($breed: String!) {
dog(breed: $breed) {
images {
url
Expand Down

0 comments on commit e28f44f

Please sign in to comment.