Giter VIP home page Giter VIP logo

data-source-xkcd's Introduction

GrAMPS · An easier way to manage the data sources powering your GraphQL server

GrAMPS GraphQL Data Source for xkcd

license npm version Build Status Maintainability Test Coverage Greenkeeper badge

Load the latest xkcd comic, or look one up by its ID.

This is a GrAMPS data source for GraphQL.

Example Queries

To get all available fields for this data source, try out these two queries in GraphiQL. (See the quickstart for details on starting GraphiQL.)

query getLatestComic {
  getLatestComic {
    ...ComicFields
  }
}

query getComicById($id: ID!) {
  getComicById(id: $id) {
    ...ComicFields
  }
}

fragment ComicFields on XKCD_Comic {
  num
  title
  safe_title
  img
  alt
  transcript
  year
  month
  day
  link
  news
}

Use the following arguments:

{
  "id": 1900
}

Quickstart

# Clone the repo
git clone [email protected]:gramps-graphql/data-source-xkcd.git

# Move into it
cd data-source-xkcd/

# Install dependencies
yarn install

To Develop with Mock Data

Start the app with the following command:

# Develop with mock data
yarn dev:mock-data

Open the URL displayed in your console to see GraphiQL.

To Develop with Live Data

Once you’ve got your data source configured to load live data, you can enable live data in development:

# Develop with live data
yarn dev

Open the URL displayed in your console to see GraphiQL.

Notes for Developers

Currently, there is no watch capability (PRs welcome!), so the service needs to be stopped (control + C) and restarted (yarn [dev:mock-data|dev]) to reflect new changes to the data source.

data-source-xkcd's People

Contributors

ecwyne avatar greenkeeper[bot] avatar jlengstorf avatar timrs2998 avatar

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.