Skip to content

Creating a server that exposes a graphql endpoint that returns "This is the answer about the Query !" when queried via something like curl or postman.

Notifications You must be signed in to change notification settings

RedaZenagui/golangTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

golangTest

Création d'un serveur qui expose un noeud graphql point qui retourne "This is the answer about the Query !" lorsqu'il est interrogé.

Installation

Ajouter le package Graphql dans Golang en utilisant la commande : go get "github.com/graphql-go/graphql"

Lancer le serveur

En utilisant la commande : go run main.go

L'envoie d'une requete

On utilise le noeud point /graphQL

En utilisant une requete POST:

Comme notre serveur est limité, la requete doit etre comme ceci :

{ 'query: {str} }

En utilisant une requete GET:

la requete doit etre comme ceci : localhost:400/graphql?query={str}

About

Creating a server that exposes a graphql endpoint that returns "This is the answer about the Query !" when queried via something like curl or postman.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages