Skip to content

Fake-faker-API/Fake-faker-GraphQL-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This collection of open-source GraphQL APIs helps developers produce mock/fake data for their applications.

This is a GraphQL version of Fake Faker REST API. Docs for the REST API can be found here.

How to use:

  • GraphQL IDE

navigate to https://fakefaker-graphql.herokuapp.com/ the page loads GraphQL IDE by default

Example query:

query Users($rowNum: Int) {
  users(rowNum: $rowNum) {
    first_name
    last_name
    email
    password
    id
  }
}

In QUERY VARIABLES include the value for rowNum, for example:

{
  "rowNum": 16,
}

Example request:

 curl --request POST \
         --header 'content-type: application/json' \
         --url 'http://localhost:3000/' \
         --data '{"query":"query { addresses {id street_name city } }"}'

Example Response:

{
  "data": {
    "addresses":
    [{
      "id":"1",
      "street_name":"Buckingham Drive",
      "city":"Beach"
    },
    {
      "id":"2",
      "street_name":"2nd Avenue",
      "city":"Pryor"
    }]
  }
}