• This repository has been archived on 22/Jun/2019
  • Stars
    star
    149
  • Rank 248,619 (Top 5 %)
  • Language
    TypeScript
  • Created almost 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Hosted faker GraphQL endpoint for frontend developers

FakerQL

FakerQL was created for frontend developers and GraphQL powered apps. Whether you're getting started with a new project or learning Relay/Apollo, you can forget about building a custom server and rely on Faker.js to provide some goodies!

Give it a try

You can head over to GraphiQL to send some example queries and mutations.

Queries

Get authorised user

You can request the logged in user provided you pass a valid Authorization header with a signed JWT. This can be done using the register/login mutations.

# me

{
  me {
    id
    firstName
    lastName
    email
    avatar
  }
}

Get a list of users

You can request a list of users. count is optional and defaults to 25.

# allUsers(count: Int)

{
  allUsers(count: 5) {
    id
    firstName
    lastName
    email
    avatar
  }
}

Get a User

You can request a single User by providing any ID.

# User(id: String!)

{
  allUsers(id: "wk0z1j1tzj7xc0116is3ckdrx") {
    id
    firstName
    lastName
    email
    avatar
  }
}

Get a list of products

You can request a list of products. count is optional and defaults to 25.

# allProducts(count: Int)

{
  allProducts(count: 5) {
    id
    name
    price
  }
}

Get a Product

You can request a single Product by providing any ID.

# Product(id: String!)

{
  allProduct(id: "cjbrygtdz3e480147hv8ozt40") {
    id
    name
    price
  }
}

Get a list of todos

You can request a list of todos. count is optional and defaults to 25.

# allTodos(count: Int)

{
  allTodos(count: 5) {
    id
    title
    completed
  }
}

Get a Todo

You can request a single Todo by providing any ID.

# Todo(id: String!)

{
  Todo(id: "cjbrygq0u3e4301476mfqoaae") {
    id
    title
    completed
  }
}

Get a list of posts

You can request a list of posts. count is optional and defaults to 25.

# allPosts(count: Int)

{
  allPosts(count: 5) {
    id
    title
    body
    published
    createdAt
    author {
      id
      firstName
      lastName
      avatar
    }
  }
}

Get a Post

You can request a single Post by providing any ID.

# Post(id: String!)

{
  Post(id: "cjbryfb1x3e3c0147f4f4110o") {
    id
    title
    body
    published
    createdAt
    author {
      id
      firstName
      lastName
      avatar
    }
  }
}

Mutations

Register user

Registering a User returns a random signed JWT. expiresIn is optional and pretty much pointless right now.

# register(email: String!, password: String!, expiresIn: String)

mutation {
  register(email: "[email protected]", password: "F4K3rqL!", expiresIn: '24h') {
    token
  }
}

Login user

Logging in a User returns a random signed JWT. expiresIn is optional and pretty much pointless right now.

# login(email: String!, password: String!, expiresIn: String)

mutation {
  login(email: "[email protected]", password: "F4K3rqL!") {
    token
  }
}

Updating user

This mutation returns the updated data you passed in to update.

# updateUser(id: ID!, email: String!, firstName: String, lastName: String)

mutation {
  updateUser(id: "wk0z1j1tzj7xc0116is3ckdrx", firstName: "Jim") {
    id
    firstName
    lastName
  }
}

➑️ You must specify the header Authorization: Bearer token to satisfy this mutation.

Create Todo

This mutation returns the data you sent arguments + a fake ID.

# createTodo(title: String!, completed: Boolean)

mutation {
  createTodo(title: "Book movie tickets") {
    id
    title
    completed
  }
}

Subscriptions

Coming soon.

Client side library example

The example below uses graphql-request.

import { request } from 'graphql-request';

const query = `{
  products: allProducts(count: 25) {
    id
    name
    price
  }

  user: User(id: "wk0z1j1tzj7xc0116is3ckdrx") {
    id
    firstName
    lastName
    email
    avatar
  }
}`;

request('https://fakerql.com/graphql', query).then(data => console.log(data));

Todo

  • Subscriptions
  • Custom directives

More Repositories

1

create-react-app-redux

React Router, Redux, Redux Thunk & Create React App boilerplate
JavaScript
919
star
2

headless-dropshipping-starter

Create your own dropshipping store with Next.js, Snipcart & Printful πŸ‘•
TypeScript
715
star
3

react-use-cart

React hook library for managing cart state
TypeScript
331
star
4

commerceql

UNMAINTAINED
JavaScript
212
star
5

awesome-headless-commerce

A community curated list of headless commerce APIs, products, and services. A heads-up for modern store builders.
117
star
6

jamstackbb

Simple forum software powered by Next.js and GraphQL.
JavaScript
48
star
7

chatbase

TypeScript
38
star
8

graphql-server-tutorial

JavaScript
33
star
9

graphql.wtf

Learn something new with GraphQL, every week πŸ‘‡πŸ»
TypeScript
29
star
10

nextjs-commercejs-example

JavaScript
16
star
11

nextjs-tailwindcss-starter

JavaScript
15
star
12

graphqlconf-2019

Website implementation of GraphQL Conf 2019
JavaScript
15
star
13

printful-request

JavaScript
14
star
14

apollo-federation-zeit-now-demo

JavaScript
12
star
15

graphcms-nextjs-example

JavaScript
11
star
16

nuxtjs-commercejs-example

Vue
9
star
17

apollo-datasource-givefood

πŸ₯« Apollo data source for GiveFood API.
JavaScript
8
star
18

nextjs-stripe-intents

JavaScript
8
star
19

gatsby-source-transistorfm

πŸŽ™ Gatsby source plugin for fetching show and episode data from Transistor
JavaScript
8
star
20

producthunt-graphql-layer-clone

JavaScript
7
star
21

express-babel-starter

πŸ”₯ Babel / ExpressJS Starter Kit
JavaScript
7
star
22

dotfiles

My dotfiles ⚑️
Shell
6
star
23

create-react-app-apollo-redux

Get started using React with Redux & Apollo.
JavaScript
6
star
24

styledbyme-tutorial

https://www.youtube.com/watch?v=u6gQ48rSw-E
JavaScript
6
star
25

graphql.wtf-type-safe-resolver-codegen

TypeScript
6
star
26

react-graphql

JavaScript
6
star
27

cmsly

Build your own branded short links with GraphCMS & Vercel
JavaScript
6
star
28

next-graphql-handler

JavaScript
5
star
29

chec-request

Lightweight Chec eCommerce client for Node, browsers and serverless functions
JavaScript
5
star
30

gatsby-source-chec-example

JavaScript
4
star
31

graphcms-migrate

JavaScript
4
star
32

now-next-graphql-monorepo

JavaScript
4
star
33

graphql.wtf-graphql-helix-nextjs

JavaScript
4
star
34

zeit-apollo-server

JavaScript
4
star
35

page-reactions-with-sveltekit

Svelte
3
star
36

shortcuts

Handlebars
3
star
37

frontendne-graphql-demo

JavaScript
3
star
38

graphtools-tutorial-code

JavaScript
3
star
39

create-react-app-hapi

JavaScript
3
star
40

apollo-modules-example

JavaScript
3
star
41

create-react-app-apollo

HTML
3
star
42

micro-stripe-charge

JavaScript
3
star
43

graphql.wtf-merging-resolvers

JavaScript
3
star
44

gatsby-source-trackingmore

Gatsby source plugin for fetching carriers from Trackingmore.com
JavaScript
3
star
45

graphql.wtf-remix-graphql

JavaScript
3
star
46

dynamic-graphql-nextjs-forms

JavaScript
2
star
47

commercejs-graphql-server

JavaScript
2
star
48

moltin-graphql-storefront-example

JavaScript
2
star
49

graphcms-remix-starter

TypeScript
2
star
50

graphiqlbin

JavaScript
2
star
51

sapper-commercejs-example

JavaScript
2
star
52

gatsby-theme-transistorfm

πŸŽ™ Gatsby theme for Transistor
JavaScript
2
star
53

apollo-server-givefood

Make requests to Give Food API using GraphQL.
JavaScript
2
star
54

gatsby-starter-netlify-cms

JavaScript
2
star
55

graphcms-gatsby-source-graphql

JavaScript
2
star
56

gatsby-plugin-statickit

JavaScript
2
star
57

graphql.wtf-graphql-codegen-apollo-client

TypeScript
2
star
58

next-commerce

1
star
59

use-snipcart

TypeScript
1
star
60

sanity-gatsby-blog

Blog with Gatsby
JavaScript
1
star
61

graphql.wtf-graphql-yoga

TypeScript
1
star
62

getwalter

Ruby
1
star
63

graphsale-dashboard

JavaScript
1
star
64

testtt

1
star
65

graphql.wtf-graphql-yoga-2

TypeScript
1
star
66

graphql.wtf-sdl-descriptions

TypeScript
1
star
67

babel-pkg-starter

JavaScript
1
star
68

graphql.wtf-serverless-graphql-vercel

JavaScript
1
star
69

notrab

1
star
70

productshare

Build a voting platform in 7 days.
Ruby
1
star
71

graphql.wtf-remote-schema-stitching

JavaScript
1
star
72

gatsby-theme-cart

πŸ›’ A drop-in shopping cart theme for Gatsby
JavaScript
1
star
73

moltin-digital-file-delivery

WIP
JavaScript
1
star
74

gatsby-graphcms-snipcart-starter

JavaScript
1
star
75

norsound.com

JavaScript
1
star
76

apollo-datasources-graphcms-example

JavaScript
1
star
77

image-transformation-directive

1
star
78

graphql.wtf-kitql

TypeScript
1
star
79

express-examples

JavaScript
1
star
80

now-api-starter

TypeScript
1
star
81

graphql-in-a-rest-world-talk

JavaScript
1
star
82

moltin-react-checkout

JavaScript
1
star
83

micro-infrastructure-talk

JavaScript
1
star
84

graphql.wtf-authorization-with-graphql-shield

JavaScript
1
star
85

nextjs-styled-components-semantic-ui

JavaScript
1
star
86

moltin-cli2

JavaScript
1
star
87

react-redux-express-starter

Boiler plate code for getting started with Create React App + Redux + Express
JavaScript
1
star
88

tailwind-dark-mode-switcher-example

JavaScript
1
star
89

moltin-graphql-checkout

TypeScript
1
star
90

react-stick-it

JavaScript
1
star
91

vue-commercejs

JavaScript
1
star
92

graphql.wtf-envelop-response-cache

TypeScript
1
star
93

video-graphql-middleware

JavaScript
1
star
94

gatsby-theme-graphcms-docs

JavaScript
1
star
95

graphql.wtf-error-handling-union-types

TypeScript
1
star
96

sentry-integration-libsql-client

TypeScript
1
star
97

shopkit

Moltin Shopkit is a minimalist component library that enables developers to easily embed commerce inside applications built with React.
JavaScript
1
star