Zendro-dev / graphql-server

Skeleton NodeJS project for a graphQL server.
GNU General Public License v3.0
0 stars 1 forks source link

Fix the curl exmaples in the README #22

Open asishallab opened 4 years ago

asishallab commented 4 years ago

The curl examples as given in the README cause errors in the latest Cenzontle versions. E.g. the mutation m part is definitely not working. Please correct the examples so that they work.

Expected work time: 1.5 h

asishallab commented 4 years ago

A working example curl call to execute a mutation would be:

curl -X POST -d 'query=mutation{ addProgram(programDbId: 3, abbreviation: "CCC", commonCropName: "A crop as well", documentationURL: "https://example.org", objective: "This say we all", programName: "Charlie Charlie Charlie") { programName commonCropName objective }}' http://localhost:3000/graphql

And a working example curl call to execute a query would be:

curl -X POST --header "Content-Type: application/json" -d '{"query": "{ accessions { accession_id } }" }' 'http://cenzontledev.conabio.gob.mx:3000/graphql'

Note that the first example transmit the request's POST data as standard strings and not in JSON format, while the second uses JSON format.