graphql-go / graphql

An implementation of GraphQL for Go / Golang
MIT License
9.87k stars 839 forks source link

External API Example #557

Closed ShreyasSubhedar closed 4 years ago

ShreyasSubhedar commented 4 years ago

A simple example to query the external rest API

Other examples are mainly using the own JSON data/ or mutated data but in this example, I am using a live endpoint to fetch the data using graphql

P.S. (I am searching this example for a long time but never get this specific implementation) especially in Go

This example is helpful for beginners to quickly start with the API.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 92.391% when pulling ef12d2312caeb4e0bffda1492d75fb1a6b21f667 on ShreyasSubhedar:master into 33f0862d7e91c4aca9e8ed0b7940db23d4aed76b on graphql-go:master.

chris-ramon commented 4 years ago

Hi @ShreyasSubhedar thanks for putting altogether a working example for an external API, looks neat 👍

I don't think we should rely on external services to show basic examples.

Also we already have a bit similar http example: https://github.com/graphql-go/graphql/blob/master/examples/http/main.go

If you create an external GitHub repo, eg: https://github.com/ShreyasSubhedar/graphql-go-examples, we could add a link to it within the README.md in a new sub-section: Third Party Examples

ShreyasSubhedar commented 4 years ago

If you create an external GitHub repo, eg: https://github.com/ShreyasSubhedar/graphql-go-examples, we could add a link to it within the README.md in a new sub-section: Third Party Examples

Hi @chris-ramon, I created an external repo with the same URL:- https://github.com/ShreyasSubhedar/graphql-go-examples I request you to add this link into README.md in a new sub-section: Third Party Examples

Thank you.