Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/purwokertodev/go-mongo-graphql

An Experimental GraphQL Server using Golang & Mongo Db
https://github.com/purwokertodev/go-mongo-graphql

go golang golang-application golang-examples golang-server graphql graphql-go graphql-server

Last synced: about 2 months ago
JSON representation

An Experimental GraphQL Server using Golang & Mongo Db

Awesome Lists containing this project

README

        

### Golang, GraphQL & Mongo Demo

## Ingredients
- Golang version 1.7+ https://golang.org/

- Glide https://github.com/Masterminds/glide

- MongoDb https://www.mongodb.com/

## Install Dependencies
```shell
$ glide install
```

## Running
```shell
$ MONGO_HOST=localhost MONGO_DB_NAME=tutorial1 go run main.go
```

## graphql
- Create Profile
```shell
$ curl -g 'http://localhost:8080/graphql?query=mutation+_{createProfile(id:"U5",firstName:"Andre",lastName:"De",email:"[email protected]",password:"123456"){id,firstName,lastName,email,password,createdAt,updatedAt}}'
```

- Get Profile
```shell
$ curl -g 'http://localhost:8080/graphql?query={profile(id:"U3"){id,firstName,email}}'
```

- Get Profiles
```shell
$ curl -g 'http://localhost:8080/graphql?query={profiles{id,firstName,email,password,updatedAt}}'
```

###

2018 Purwokerto Dev