Skip to content

Latest commit

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Description

Testing the GraphQL server implementation.

Use

Run yarn dev and open localhost:4000

Queries and mutations

Ask highlights

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 for an individual note by including an ID parameter with our query
query{highlight(id: "1"){
content
}}

Result:

{"data": {"highlight": {"content": "One day I will find the right words, and they will be simple."}}}
Mutation: Add Record
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: Delete Record
mutation{deleteHighlight(id: "3"){
id
}}

Result:

{"data": {"deleteHighlight": {"id": "3"}}}

Sources

Get Started Building GraphQL APIs With Node

About

GraphQL server test implementation.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages