Giter Club home page Giter Club logo

howtographql's Introduction

How to GraphQL 🎓

How to GraphQL is a fullstack tutorial website to learn all about GraphQL! It was built by Prisma and many amazing contributors. All content on the site is completely free and open-source.

Note: This repository is currently mostly unmaintained. We are looking for maintainers who can help cleaning up issues and PRs opened by the community. If you are interested in helping out, please reach out!

Content

The content for all tutorials is located in the /content directory. Here is an overview of all the tutorials that are available at the moment:

GraphQL

  • Fundamentals of GraphQL
  • Advanced GraphQL

Frontend

  • React & Apollo
  • React & Relay (Out of date)
  • Vue & Apollo (Out of date)
  • Ember & Apollo (Out of date)

Backend

  • javascript-apollo / JavaScript & Apollo
  • typescript-apollo / Typescript & Apollo
  • typescript-helix / Typescript & Helix
  • graphql-elixir / Absinthe & Elixir
  • graphql-ruby / Ruby and GraphQL Gem
  • graphql-python / Python & Graphene
  • graphql-go / Go & gqlgen
  • graphql-scala / Scala & Sangria
  • graphql-java / Java (Out of date)

Contributions / Fixes

As the whole project is open-source, you're more than welcome to fix typos and other small issues yourself and create a PR for the fix. If you want to contribute a whole tutorial track or update one of the out of date tutorials please get in touch.

Installation & Running locally

The project has some native (gyp) dependencies. To get this running, please make sure your environment it set with the following:

  1. Make sure to install a Node version manager (either fnm or nvm)
  2. Point your environment to the version specified in .nvmrc.
  3. Make sure to load .env to your environment variables (some shell loads it automatically, but if not, you can do: source .env to load it)

You can run a local instance of How to GraphQL by executing the following commands in a terminal:

git clone [email protected]:howtographql/howtographql.git
cd howtographql
yarn install
yarn start # http://localhost:8000/

Note: If you're using Node 8, you might need to invoke npm install -g node-gyp before you're starting the app. More info here.

Troubleshooting

If you are having issues with sharp dependency, please make sure you have installed >0.18.2 of it. Older versions have hardcoded dependency on a legacy artifactory.

To check the version you have, run: yarn why sharp.

If you are still having issues, please make sure that you have SHARP_DIST_BASE_URL environemnt variable set correctly (see .env file) and then run yarn install again.

howtographql's People

Contributors

anku255 avatar ashwamegh avatar benwilson512 avatar chenkie avatar chrish-21 avatar ciceropablo avatar davidmsvetlecic avatar devanb avatar gabehollombe avatar huan avatar jolg42 avatar julianbauer avatar kitten avatar lebedev avatar mairatma avatar marioosh avatar marktani avatar matt-dionis avatar nikolasburk avatar nsanitate avatar petradonka avatar probil avatar ri-allen avatar robin-macpherson avatar rstankov avatar supergoat avatar tasinishmam avatar thewillwill avatar timsuchanek avatar xuorig 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  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

howtographql's Issues

`<Instruction>` blocks not working for numbered lists

I've noticed today, while adding some instruction annotations to the graphql-js tutorial, that one of the places I was trying to add it to wasn't working. It seems to be something related to ordered lists. I'm adding <Instruction> right before such a list like this:

It's time to start creating your project. For this, follow these steps:

<Instruction>

1. First, you'll need is to have Node.js installed on your machine. If you don't yet, make sure to do it [now](https://nodejs.org/en/). Note that the code samples here assume the latest versions of Node.js, with ES6 support, so it's best if that's what you have as well.
2. Setup your **package.json** by typing `npm init -y` in the terminal, inside the folder of your choice.
3. Install dependencies: 

```
npm i —save express body-parser graphql-server-express graphql-tools graphql
```

</Instruction>

But it's just ignored when I run the site with gatsby:

screen shot 2017-07-03 at 5 12 49 pm

If I move the opening <Instruction> tag up to the paragraph right before the list, it's detected, but the list itself isn't shown:

screen shot 2017-07-03 at 5 06 53 pm

Links are hard to find inside instruction blocks

I've just noticed that links inside instruction blocks are not very noticeable. They look like regular text unless tou actually try hovering over them, which can be bad in some cases, as the reader needs to know about the link beforehand.

For example, without hovering:
screen shot 2017-07-10 at 4 10 59 pm

After hovering:
screen shot 2017-07-10 at 4 11 08 pm

I'd expect the links to show up as bold text or another color, like they do outside instruction blocks, for example:

screen shot 2017-07-10 at 4 13 56 pm

Just a suggestion :)

Validation errors for schema

Currently the mutations look like the following:

type Mutation {
  signinUser(email: AUTH_PROVIDER_EMAIL): SigninPayload!
  createUser(name: String!, authProvider: AuthProviderSignupData!): User
  createLink(description: String!, url: String!, postedById: ID): Link
  createVote(linkId: ID, userId: ID): Vote
}

One problem is how are we going to handle validation errors.


For example createLink can fail if url is already posted or description is too short.

The current schema doesn't express this. If keep the current schema, the only way to handle is through the graphql build-in errors, which are quite hard to handle on the client forms.

In my projects, I use the following format for mutations:

type Mutation {
  // have Relay style input, makes it easy 
  // to get form state and dump it directly into the mutation
  // (this would also make the schema usable in Relay examples)
  createLink(input: CreateLinkInput): CreateLinkPayload
}

input CreateLinkInput {
  description: String!
  url: String!
  postedById: ID
}

// all mutations return `node` (created/updated/remove) root node
// and array of errors  (having those make it easy to present them in a form)
type CreateLinkPayload {
  node: Link
  errors: [ValidationError!]
}

// error contain field, message (can be code or user presentable string)
type ValidationError {
  field: String!
  message: String!
}

What do you think?

Discuss: Terminology

We need to agree to the terminology for the following things:

  • "Chapter": A piece of content as part of a "Tutorial" (usually a page of content with a distinct URL and backed by a single Markdown file. Often also contains a video)
  • "Tutorial": A collection of chapters to teach a specific technology (Examples: GraphQL basics, React + Apollo, React + Relay...)
  • "HTG": Acronym which can be used at least for internal documentation.

Design content page

Challenges

  • Mobile/responsive design
  • How to display content of previous track?

Draft

content-3

Design content overview page

Challenges

  • How to highlight a certain track as the default choice?
  • How to separate between backend and frontend tracks?
  • Plan for more content tracks
  • Make clear that advanced GraphQL lessons are not mandatory to continue with FE/BE tracks
  • Mobile/Responsiveness

Draft

img_1863

add support for graphql-go

  • First create the example project in go (a Hackernews clone based on the GraphQL schema that’s also used in the other frontend/backend tracks)

  • Then write the tutorial similar to the other tutorials

Website Implementation

Todo General

  • content overview landingpage (1h)
  • author bio view, author bio data, author frontmatter (1h)
  • video author view (0.5h)
  • final success screen (2h)
  • add bonus chapter screen (0.5h)
  • localstorage tracking + score calculation (1h)
  • reflect seen chapters to steps (0.5h)
  • implement question data structure + handling of wrong questions (0.5h)
    • hide question when answered correctly
    • show correct next chapter count n
    • also reset answers
  • minor sidebar css issues (in sum 1h)
    • bullets background color (10min)
    • last point without line (15min)
    • GRAPHQL THEORY same alignment as points (5min)
  • nav dropdowns (1.5h)
  • search (1.5h)
    SUM: 11h

added later

  • fix [object Object] problem in prerendered versino
  • implement stack switch
  • increase animation time based on path length
  • stop answers from jumping
  • hide skip when answered
  • vertical alignment questions
  • menu dropdown - real links
  • menu dropdown - close on click
  • search - real results
  • explore caption for image solutions
  • video play icon
  • remove header easter eggs

Mobile

Todo Mobile

  • landingpage (4h)
  • markdown (1h)
  • questions (0.5h)

Needed Design Solutions Julian

  • done chapter in Chooser on Landinpage
  • Chapter overview - overflow, same for sidebar
  • success screen mobile

Needed SVGs

  • logos for different technologies
  • header hamburger svg
  • next chapter + bonus icons
  • play symbol video preview
  • medal for success screen

Mobile Responsiveness Julian

  • Intro
  • Chooser
  • Header (just nav), Tim will do dropdown later
  • Learn by Building Section
  • Community Section
  • Content Overview Section

Questions

  • Watch Overview: Video modal?

Fine Tuning

  • Relay Logo too big
  • more lineheight for content overview
  • line height of copy

Feedback @schickling

  • Track selection: Backend tracks should include the language logo (nodejs + graphql logo, python + graphene logo, ...)
  • Fav icon is missing
  • Remove Lee Byron + Facebook for now
  • Add Sashko + Apollo logo
  • Hover states
  • Adjust headline sizes to match Graphcool docs
  • Reflect site title in <title>
  • Use same logo order as in design for tutorial selection (react/apollo in the center)
  • Add beginner's choice
  • Success section should have coloured confetti 🎉
  • Test section: The skip button should be hidden when answered correctly
  • Frontpage: Video icon + duration should be clickable and directly trigger autoplay on the chapter page
  • Replace hackernews picture with video (use ffmpeg to compress - see graphql-up/freecom for example)
  • Content folder needs to be on root level: /content
  • Make Graphcool link in footer a subtle link
  • Add rounded arrow to playground section on frontpage
  • Make community section rather wide than high
  • Top nav github button should be target=_blank
  • "Edit this page on Github" button
  • Add preview banner
  • Remove docs label on frontpage playground
  • Page flickers on first load
  • Content doesn't scroll smoothly on mobile
  • frontpage playground: Query is malformated

Feedback @nikolasburk

  • Add "Coming Soon"-label in chooser

Design Logo

Ideas:

  • Based on GraphQL logo
  • Should communicate "learning" or "tutorial" 🎓
  • Possibly GraphQL pink

Design Homepage

What it should communicate

  • THE entrypoint for learning GraphQL
  • Target audience: Frontend + backend developers
  • Covers every level: From beginner level to building advanced applications
  • 3 segment content: 1) GraphQL 2) Frontend 3) Backend
  • Rich content format: Detailed text + video courses & Code examples

Challenges

  • Mobile/Responsive design
  • Show enough content so it seems comprehensive but not overwhelming

Sections/Elements

  • Hero: Communicate message + CTA (GraphQL, Frontend or Backend)
  • First GraphQL query (probably the first time a person runs a GraphQL query -> makes curious -> CTA GraphQL)
  • Framework/technology overview
  • For the community by the community
  • Content overview (outline for all (or most important) tracks)

Draft

artboard copy 10

Design Suggestions

  • instruction blocks in the content should be visually marked so that readers can potentially skip content and only follow the instructions if they want to get through quicker
  • code blocks should have a way to be annotated, e.g. with the file name where that code is located
  • there should be two kinds of code blocks, one that communicates that the user needs to paste the contents in their own code, the other one communicates that this is example code that the user doesn't have to take any action on

React + Apollo: Loading Links [2]

The last line of the Queries: Loading Links chapter of the React + Apollo tutorial reads:

That’s it! Go ahead and run yarn start again. You should see the exact same screen as before.

But as no mutations have been executed as part of the chapter, the content of the response to the query is an empty list of links: {"data":{"allLinks":[]}}, so the 2 links provided as mock data are no longer displayed.

Prepare content structure

Content

  • GraphQL
  • Frontend
    • React + Apollo
    • React + Relay
    • Expo + Apollo
    • Vue + Apollo
    • Angular + Apollo (minimal)
  • Backend
    • Express / Apollo tools
    • Graphcool
    • Ruby/Rails
    • Scala/Sangria (Feedback from @OlegIlyenko
    • Python
    • Java

Format

  • Final headlines (for sidenav)
  • Description blurb to get feedback #20

Learning Sequence for Graphcool CLI Commands [0.5]

On the second lesson of the Graphcool tutorial the graphcool status command is taught after the graphcool push command has likely been put into the learner's console. This might stop them from seeing what graphcool status will output. I think if you are going to include the graphcool status command in this tutorial, which I think makes sense, it'd be the best learning experience if they were introduced to it before they push their data off to the server.

I am willing to come up with a few changes here if you think this would be a good change.

non ascii dash in command in graphql-js/1-getting-started.md

At "Install Dependancies" install command

npm install —save express body-parser graphql-server-express graphql-tools graphql

should have ascii dash - before save, so should be,

npm install -save express body-parser graphql-server-express graphql-tools graphql

Typo in advanced more graphql concepts

This brings up a different problem: In a GraphQL query where we ask want to retrieve information about a Child but only have a Person type to work with, how do we know whether we can actually access this field?

I think maybe the correct would be:
This brings up a different problem: In a GraphQL query where we ask to retrieve information about a Child but only have a Person type to work with, how do we know whether we can actually access this field?

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.