Git Product home page Git Product logo

learning-graphql's Introduction

Learning GraphQL

The code samples for Learning GraphQL by Eve Porcello and Alex Banks, published by O'Reilly Media

Learning GraphQL Book Cover If you are ready to start building fullstack applications with GraphQL, Apollo, and React, this book is for you. In this book, Eve Porcello and Alex Banks provide a complete overview of GraphQL from the ground up which includes building your own full stack photo sharing application.

Buy the book: Amazon - O'Reilly
Take the Course: GraphQL Workshop

Table of Contents

learning-graphql's People

Contributors

eveporcello avatar moontahoe avatar oluwasetemi avatar sweet-bob 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

learning-graphql's Issues

GitHub authentication is completely broken

The authentication URL does not work anymore once you've got your Token.

It is no more : https://api.github.com/user?access_token=[token]

But : https://api.github.com/user with the token in the 'Authorization' header. The problem is that I could never make this work even following this documentation :

https://docs.github.com/en/developers/apps/authorizing-oauth-apps#2-users-are-redirected-back-to-your-site-by-github

Could you please fix the code on the repo since it renders basically chapters 5, 6 and 7 useless ?

GraphQL Playground links not working

Hi Alex, Hi Eve,

I've started your book recently (Kindle version), everything was great so far but I just noticed that the links to GraphQL Playground example code were always redirected to this link
Unfortunately it prevents me working with the example code.
Is there a way to fix it ?

Thanks and congrats for the book, I am really enjoying it so far !

Chapter 5 configuring an express server

Hello,
i've got an error to my code and i don't fix it:

GraphQLError [Object]: Syntax Error: Cannot parse the unexpected character "/".

Can yotu help me to found an issue
Fairthfully

Subscriptions not working in /playground

Hello. I couldn't get the subscriptions firing in the /playground url.

I added the subscriptionEndpoint property to fix it.

app.get( "/playground", expressPlayground({ endpoint: "/graphql", subscriptionEndpoint: "ws://localhost:4000/graphql" }) );

Hope this helps someone.

Java

Adorei o livro, sentir falta somente, de uma api usando java, ja que java e a linguagem mais usada no mundo para escrever api REST, no proximo livro vai contemplar isso ,,,,

Obrigado.,..

[chapter 5] fix User inPhotos logic

I read Japanese edition and found a mistake that is not related to a main topic

The below code is written in a book

    inPhotos: (parent: any) =>
      tags
        .filter((tag) => tag.userID === parent.id)
        .map((tag) => tag.photoID)
        .map((photoID) => photos.find((p) => p.id === photoID))

However correct code is below

    inPhotos: (parent: any) =>
      tags
        // NOT parent.id BUT parent.githubLogin
        .filter((tag) => tag.userID === parent.githubLogin)
        .map((tag) => tag.photoID)
        .map((photoID) => photos.find((p) => p.id === photoID))

tag.userID is githubLogin ("gPlake") NOT id ("1")

Complete all Readme.md documents

Finalize each of the following Readme.md documents:

  • ch5 photo-share-api readme
  • ch6 photo-share-client readme
  • ch7 readme
  • ch7 mock-photo-api readme
  • ch7 photo-share-api readme
  • ch7 photo-share-client readme

Make sure each Readme provides enough information to install and run the api at it's current state. Also make sure all overviews and any necessary resource links have been provided.

User postedPhotos connection bug

In the User type resolver, the connected postedPhotos field is not returning data. We need to change the filter from parent._id to parent.githubLogin.

From:

postedPhotos: (parent, args, { db }) => 
            db.collection("photos")
                .find({ userID: parent._id })
                .toArray(),

To:

postedPhotos: (parent, args, { db }) => 
            db.collection("photos")
                .find({ userID: parent.githubLogin })
                .toArray(),
  • Replace in Chapter 5
  • Replace in Chapter 6
  • Replace in Chapter 7

Chapter 6: Apollo Client with React and Caching -> why use restore instead of await persistCache?

Chapter 6 does praise Apollo Client for providing a cache (among many other things). However, the suggested way of using apollo-boost with react-apollo does not make proper use of the cache.

When following along with chapter 6 all the way to the end of the paragraph about react-apollo's Query component I noticed that the application does not showcase the caching mechanism suggested by the book. Reloading the application will always cause a POST request to be sent to the GraphQL API.

Lock Down Package Versions

All versions in every package.json file should be specific. No ^ or * or anything automatic. We need to wait until Apollo Server 2.0 is out of rc.

  • Apollo Server 2.0 released
  • package.json files locked.

DOMException: Failed to construct 'WebSocket': The URL '/graphql' is invalid.

Actual behavior: After cloning chapter 7 and npm install then npm start the above error occurs when running the following query in /playground:

subscription { newPhoto { name url postedBy { name } } }
I was encountering the same error after following the directions in the book.

Also ws://localhost:4000/ does not connect, with the browser stating This site can’t be reached

Expected behavior: When the instructions are followed in the book, or when the repo is cloned and started, there should be no errors.

I suspect this has to do with new npm packages being released, but am seeking clarity as the repo seems to have been created 4 months ago with updates as recently as 2 months ago.

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.