Git Product home page Git Product logo

book's Introduction

Table of Contents

Supporting

If you'd like to read the Guide, and if you can afford to purchase it or if your company reimburses you for educational materials (most do ๐Ÿ‘), we would value your support: https://graphql.guide.

Contributors

/GraphQLGuide/book/graphs/contributors

Thank you to everyone who has contributed ๐Ÿ˜ƒ ๐Ÿ™Œ

Contributing

We welcome issues and PRs! For large changes, we recommend opening an issue first to get feedback before putting in the work of a PR. Minor things like typo fixes or suggested re-wordings can go directly to PRs and will usually get a quick response ๐Ÿ˜Š

Text

Formatting

  • Use curly quotes (โ€œ โ€˜ โ€™ โ€) unless inside code blocks, in which case use straight quotes (' ")

Setup

If you're working on gitbook-related issues or want to see how your PR will be formatted, follow these steps to get set up after cloning:

npm i -g gitbook-cli
gitbook install
mkdir out/
cd scripts
./build.sh

Site

With local theme

git clone https://github.com/GraphQLGuide/gatsby-theme-apollo.git
git clone https://github.com/GraphQLGuide/book.git
cd book/
connect-deps link ../gatsby-theme-apollo/packages/gatsby-theme-apollo-docs ../gatsby-theme-apollo/packages/gatsby-theme-apollo-core --connect --watch

Changelog

book's People

Contributors

brettcannon avatar charpeni avatar dependabot[bot] avatar fxone avatar imgbot[bot] avatar jrnt30 avatar lorensr avatar mixophrygian avatar mziemer21 avatar ogidow avatar pramshaw avatar qafui avatar qwertypants avatar spiffcs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

book's Issues

Updated syntax in book/text/1.md

Chapter 1 - line 231

Current syntax leads to "errors":[{"message":"POST body sent invalid JSON."}]}

Expected Behavior

$ curl -X POST -H "Content-Type:application/json" \
>     -d '{user(id: "123"){_id, username}}' \
>     http://localhost:3000/graphql
{"data":{"user":{"_id":"123","username":"jeresig"}}}

Current Behavior

$ curl -X POST -H "Content-Type:application/json" \
> -d '{user(id: "123"){_id, username}}' \
> http://localhost:3000/graphql
{"errors":[{"message":"POST body sent invalid JSON."}]}

Possible Solution

$ curl -X POST -H "Content-Type:application/json" \
> -d '{"query": "{user(id: \"123\"){_id username}}"}' \
> http://localhost:3000/graphql
{"data":{"user":{"_id":"123","username":"jeresig"}}}

Steps to Reproduce

  1. git clone https://github.com/GraphQLGuide/graphql-rest-api-demo.git
  2. node graphql-server.js
  3. Execute query from Chapter 1 line 231

Environment

node: v10.4.1
npm list report for graphql:

โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”œโ”€โ”€ [email protected] deduped
โ”‚ โ”œโ”€โ”€ [email protected] deduped
โ”‚ โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”‚ โ”œโ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚ โ”‚ โ”œโ”€โ”€ [email protected] deduped
โ”‚ โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚ โ””โ”€โ”ฌ [email protected]
โ”‚   โ”œโ”€โ”€ [email protected] deduped
โ”‚   โ”œโ”€โ”ฌ [email protected]
โ”‚   โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚   โ”‚ โ”œโ”€โ”€ [email protected] deduped
โ”‚   โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚   โ”‚ โ””โ”€โ”€ [email protected] deduped
โ”‚   โ”œโ”€โ”€ [email protected] deduped
โ”‚   โ””โ”€โ”€ [email protected] deduped
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ””โ”€โ”€ [email protected]

Possible Implementation

I can make a quick pr to update this to the proposed possible solution if you want.

Where are the other formats?

On the store page, it says that the book is available "in HTML, PDF, ePub, and Kindle formats". After purchasing, (Basic) I received a link to the HTML version, but I can't find any links to the other versions anywhere.

There seems to be no download information in the book, the store site, the Github site, the purchase receipt, or my graphql.guide/me/ page.

Am I simply dense, and missing something obvious?

Regards

Gql document naming pattern

Atm we have:

  • all caps
  • end with the operation, eg STARS_QUERY, FAVORITE_MUTATION
const DELETE_REVIEW_MUTATION = gql`
  mutation DeleteReview($id: ObjID!) {
    removeReview(id: $id)
  }
`

What do we think about dropping the operation from the end?

Add book to goodreads

I track all the books I'm reading on goodreads and thought it would be great to have this book as well.
I added a minimal initial template over here.

I'd be glad to get help from the authors to add description, better cover image and any other missing field.

Periodically delete persisted cache

So that updated section content can be fetched. Either every N days or w/ versioning. Probably by deleting localStorage key instead of using CachePersistor

Schemata?

Should we replace all instances of schemas? Would be fun ๐Ÿ˜„

Error with <Modal>

When clicking the + button on /reviews:

index.js:2177 Material-UI: The modal content node does not accept focus.
For the benefit of assistive technologies, the tabIndex of the node is being set to "-1". 

image

Error: Couldn't locate plugins "prism, advanced-emoji", Run 'gitbook install' to install plugins from registry.

Following the steps to build, I get this error

$ ./build.sh 
Installing GitBook 3.2.3
[email protected] ../../../../../tmp/tmp-132665Wc85YydwvAYy/node_modules/gitbook
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected] ([email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected])
โ”œโ”€โ”€ [email protected] ([email protected])
โ”œโ”€โ”€ [email protected] ([email protected])
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected])
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected] ([email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected])
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected] ([email protected])
โ”œโ”€โ”€ [email protected] ([email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected], [email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
โ”œโ”€โ”€ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
โ””โ”€โ”€ [email protected]
info: 7 plugins are installed 

Error: Couldn't locate plugins "prism, advanced-emoji", Run 'gitbook install' to install plugins from registry.
info: 7 plugins are installed 

Chapter 5 - Missing loading prop on withData function

On chapter 6 page 83 the following withData function is show:

const withData = graphql(SECTION_QUERY, {
  props: ({ data: { section }}) => ({ section })
})

It should be:

const withData = graphql(SECTION_QUERY, {
  props: ({ data: { section, loading }}) => ({ section, loading })
})

Fix flash of wrong font on load

Use one of:

font-display: block;
font-display: swap;

and set cache header on font file. Need to either fork an apollo package or override @font-face

Images too large

Is there a way w/ gitbook to make them less than 100% width? If not, what ebook generating tool should we switch to?

datasource link redirects to a 404

on the Server section, under the Data sources chapter : "There are two main ways to talk to a database from our GraphQL resolvers: data sources and Prisma"

The link to data sources leads to a 404. i think the page has moved to Migration to V4 in the Apollo Docs.

Differentiate heading style

make client libraries stand out more, or streamlined less

# Client libraries

...

## Streamlined request function

image

Chapter 5 - Client Dev: JavaScript - example doesn't work

Hi, this example doesn't work:

const makeGraphqlRequest = async ({ endpoint, document }) => {
  const options = {
    method: 'POST',
    headers: new Headers({
      'Content-Type': 'application/json'
    }),
    body: JSON.stringify({
      query: document
    })
  }

  const response = await fetch(endpoint, options);
  return response.json()
}

const result = await makeGraphqlRequest({
  endpoint: 'https://api.graphql.guide/graphql',
  document: '{ githubStars }'
});

console.log(result);

await can't be used outside of the async, I guess it should be changed to the code you have in jsbin:

const makeGraphqlRequest = async ({ endpoint, document }) => {
  const options = {
    method: 'POST',
    headers: new Headers({ 
      'Content-Type': 'application/json' 
    }),
    body: JSON.stringify({
      query: document
    })
  }

  const response = await fetch(endpoint, options)
  return response.json()
}

async function fetchExample() {
  const document = '{ githubStars }'

  console.log('Sending query: ' + document)
  const result = await makeGraphqlRequest({
    endpoint: 'https://api.graphql.guide/graphql', 
    document
  })
  console.log('Response:', result)
}

fetchExample()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.