Git Product home page Git Product logo

formidadog-ql's Introduction

๐Ÿถ formidadog-ql ๐Ÿถ

A dead simple GraphQL API of ๐Ÿถ @FormidableLabs. See the demo here.

Build Status Coverage Status Netlify Status

What's This About

Everyone needs a good, simple GraphQL API for making demo apps. Everyone could use more dog photos in their life. And everyone is probably dying to meet the pups of the awesome team at Formidable. To that end, we present formidadog-ql.

Get Me Running!

You know the drill. Clone the repo locally, yarn, yarn start.

git clone https://github.com/parkerziegler/formidadog-ql.git
cd formidadog-ql
yarn
yarn start

This will start the server up at localhost:4000. Go ahead and change the port in src/index.js if you like. We figured you might be using localhost:3000 already ๐Ÿ˜‰.

Note: Running this app locally requires Node >= 8. We make use of async/await for startup, so make sure you're using Node 8 or above. Using LTS is recommended.

What Next?

Once you have the server running, go to localhost:4000/graphql in your browser. You'll get an awesome GraphiQL interface for writing queries, mutations, and exploring the schema.

formidadog-ql-demo

As long as you have the server running, you can hit localhost:4000/graphql from any local app to use this API.

Write a Simple Query

If you're not familiar with the basics of GraphQL, go ahead and check out How to GraphQL for tutorials and an overview. Let's write a simple query to get information on all the dogs at Formidable.

query dogs {
  dogs {
    name
    breed
    description
    imageUrl
    likes
  }
}

To obtain information on a single dog, use the dog query, which accepts a key variable to identify the dog. key is a required ID type in our GraphQL schema.

query dog($key: ID!) {
  dog(key: $key) {
    name
    breed
    likes
  }
}

You can use GraphiQL's variables editor to add the $key variable to the above query.

{
  "key": "VmeRTX7j-"
}

Write a Simple Mutation

To see what mutations are currently available on the API, use the Mutation explorer in GraphiQL. Let's execute a mutation to like one of these pooches!

mutation likeDog($key: ID!) {
  likeDog(key: $key) {
    name
    likes
  }
}

Each time we execute this mutation, we should see the mutated dog's likes increment by one.

How You Can Help

This API is not fully formed yet. There's plenty of great queries, mutations, and subscriptions left to be added. Go ahead and open a PR! If you find a bug, please file an issue.

formidadog-ql's People

Contributors

dependabot[bot] avatar parkerziegler avatar

Stargazers

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

Watchers

 avatar  avatar

formidadog-ql's Issues

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.