Testing the GraphQL server implementation.
Run yarn dev and open localhost:4000
Query all records
query{highlights{idcontenttitleauthor}}or just some fields
query{highlights{titleauthor}}Result:
{"data": {"highlights": [{"title": "Dharma Bums","author": "Jack Kerouac"},{"title": "Arbitrary Stupid Goal","author": "Tamara Shopsin"}]}}query{highlight(id: "1"){
content
}}Result:
{"data": {"highlight": {"content": "One day I will find the right words, and they will be simple."}}}mutation{newHighlight(author: "Adam Scott"title: "JS Everywhere"content: "GraphQL is awesome"){idauthortitle
content
}}Result:
{"data": {"newHighlight": {"id": "3","author": "Adam Scott","title": "JS Everywhere","content": "GraphQL is awesome"}}}mutation{deleteHighlight(id: "3"){
id
}}Result:
{"data": {"deleteHighlight": {"id": "3"}}}