{"repo":"marmelab/json-graphql-server","free":true,"listed":false,"github":"https://github.com/marmelab/json-graphql-server","clone":"git clone https://github.com/marmelab/json-graphql-server.git","description":"Get a full fake GraphQL API with zero coding in less than 30 seconds.","language":"JavaScript","stars":1949,"topics":["graphql","graphql-server","express-graphql"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"json-graphql-server Get a full fake GraphQL API with zero coding in less than 30 seconds. Motivation I'd love to learn GraphQL, but it seems that I first have to read a book about GraphQL Types and Queries, then install a gazillion npm packages. - About every developer Start playing with GraphQL right away with json-graphql-server , a testing and mocking tool for GraphQL written in Node.js. All it takes is a JSON of your data. Inspired by the excellent json-server. Usage Create a db.js file that exports an object where the keys are the entity types. The values should be lists of entities, i.e. arrays of value objects with at least an id key. For instance: Use the npx json-graphql-server command to start the GraphQL server on localhost, port 3000. To use a different port, use the --port or -p option: To use a different host, use the --host or -h option: Now you can query your data in graphql. For instance, to issue the following query: Go to http://localhost:3000/?query=%7B%20Post%28id%3A%201%29%20%7B%20id%20title%20views%20User%20%7B%20name%20%7D%20Comments%20%7B%20date%20body%20%7D%20%7D%20%7D. You'll get the following result: The json-graphql-server accepts queries in GET and POST. Under the hood, it uses the graphql-http module. Please refer to their documentations for details about passing variables, etc. Note that the server is GraphiQL enabled, so you can query your server using a full-featured graphical user interface, providing autosuggest, history, etc. Just browse h","default_branch":null,"files":null,"tree":[],"storefront":"/r/marmelab","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/marmelab/json-graphql-server/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}