All Projects → topliceanu → Graphql Go Example

topliceanu / Graphql Go Example

Licence: mit
Example GraphQL API implemented in Go and backed by Postgresql

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Graphql Go Example

Spring Examples
SpringBoot Examples
Stars: ✭ 67 (-50.37%)
Mutual labels:  graphql, postgresql
Graphjin
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.
Stars: ✭ 1,264 (+836.3%)
Mutual labels:  graphql, postgresql
Springboot Projects Fullstack
Spring Boot, JDBC, ORM, JPA, Hibernate, H2, MySQL, Oracle
Stars: ✭ 76 (-43.7%)
Mutual labels:  graphql, postgresql
Starter
Opinionated SaaS quick-start with pre-built user account and organization system for full-stack application development in React, Node.js, GraphQL and PostgreSQL. Powered by PostGraphile, TypeScript, Apollo Client, Graphile Worker, Graphile Migrate, GraphQL Code Generator, Ant Design and Next.js
Stars: ✭ 1,082 (+701.48%)
Mutual labels:  graphql, postgresql
Subzero Starter Kit
Starter Kit and tooling for authoring GraphQL/REST API backends with subZero
Stars: ✭ 136 (+0.74%)
Mutual labels:  graphql, postgresql
Rpg Boilerplate
Relay (React), Postgres, and Graphile (GraphQL): A Modern Frontend and API Boilerplate
Stars: ✭ 62 (-54.07%)
Mutual labels:  graphql, postgresql
Twist V2
A book review tool for Leanpub's Markdown Book Format
Stars: ✭ 82 (-39.26%)
Mutual labels:  graphql, postgresql
Niklick
Rails Versioned API solution template for hipsters! (Ruby, Ruby on Rails, REST API, GraphQL, Docker, RSpec, Devise, Postgress DB)
Stars: ✭ 39 (-71.11%)
Mutual labels:  graphql, postgresql
Postgraphile
GraphQL is a new way of communicating with your server. It eliminates the problems of over- and under-fetching, incorporates strong data types, has built-in introspection, documentation and deprecation capabilities, and is implemented in many programming languages. This all leads to gloriously low-latency user experiences, better developer experiences, and much increased productivity. Because of all this, GraphQL is typically used as a replacement for (or companion to) RESTful API services.
Stars: ✭ 10,967 (+8023.7%)
Mutual labels:  graphql, postgresql
Next
Directus is a real-time API and App dashboard for managing SQL database content. 🐰
Stars: ✭ 111 (-17.78%)
Mutual labels:  graphql, postgresql
K2
Koa2 API template with passport, GraphQL, flowtype, knex and more.
Stars: ✭ 44 (-67.41%)
Mutual labels:  graphql, postgresql
Directus
Open-Source Data Platform 🐰 — Directus wraps any SQL database with a real-time GraphQL+REST API and an intuitive app for non-technical users.
Stars: ✭ 13,190 (+9670.37%)
Mutual labels:  graphql, postgresql
Tinder Clone
Fullstack Tinder app clone made with React/Ts/Nest
Stars: ✭ 43 (-68.15%)
Mutual labels:  graphql, postgresql
Cynthesize Frontend
Frontend written in Angular 7 and deployed GraphQL for Cynthesize. Development build: https://cynthesize-develop.netlify.com
Stars: ✭ 65 (-51.85%)
Mutual labels:  graphql, postgresql
Postgraphile Nest
GraphQL (PostGraphile) module for Nest framework (node.js)
Stars: ✭ 43 (-68.15%)
Mutual labels:  graphql, postgresql
Open Bank Mark
A bank simulation application using mainly Clojure, which can be used to end-to-end test and show some graphs.
Stars: ✭ 81 (-40%)
Mutual labels:  graphql, postgresql
Openrecord
Make ORMs great again!
Stars: ✭ 474 (+251.11%)
Mutual labels:  graphql, postgresql
Graphql Ts Server Boilerplate
A GraphQL server boilerplate made with Typescript, PostgreSQL, and Redis
Stars: ✭ 643 (+376.3%)
Mutual labels:  graphql, postgresql
Serverless Postgraphql
Serverless GraphQL endpoint for PostgresSQL using AWS, serverless and PostGraphQL
Stars: ✭ 105 (-22.22%)
Mutual labels:  graphql, postgresql
Deploy Strapi On Aws
Deploying a Strapi API on AWS (EC2 & RDS & S3)
Stars: ✭ 121 (-10.37%)
Mutual labels:  graphql, postgresql

graphql-go-example

Example GraphQL API implemented in Go and backed by Postgresql

How to run it

To run this project you need to:

  • install golang, see this guide
  • install Masterminds/glide which is a package manager for golang projects.
  • install all the dependencies for this project: glide install, glide will store all dependencies in /vendor folder.
  • install postgresql (for ubuntu follow this guide). For this application, I created a postgresql user called vagrant with vagrant as password and the database called graphql, but of course you can change these settings in ./migrate.sh and in ./main.go files.
  • install mattes/migrate which is a tool to create and run migrations against sql databases.
  • run the migrations which will create the database tables and indexes ./migrate.sh up. If you ever want to clean up the the database run ./migrate.sh down then ./migrate.sh up again.

Commands

This application exposes a single endpoints /graphql which accepts both mutations and queries. The following are examples of curl calls to this endpoint:

curl -XPOST http://vm:8080/graphql -d 'mutation {createUser(email:"[email protected]"){id, email}}'
curl -XPOST http://vm:8080/graphql -d 'mutation {createUser(email:"[email protected]"){id, email}}'
curl -XPOST http://vm:8080/graphql -d 'mutation {follow(follower:1, followee:2)}'
curl -XPOST http://vm:8080/graphql -d 'mutation {unfollow(follower:1, followee:2)}'
curl -XPOST http://vm:8080/graphql -d '{user(id:2){followers{id, email}}}'
curl -XPOST http://vm:8080/graphql -d '{user(id:1){followers{id, email}}}'
curl -XPOST http://vm:8080/graphql -d '{user(id:2){follower(id:1){ email}}}'
curl -XPOST http://vm:8080/graphql -d '{user(id:1){followees{email}}}'
curl -XPOST http://vm:8080/graphql -d '{user(id:1){followee(id:2){email}}}'
curl -XPOST http://vm:8080/graphql -d 'mutation {createPost(user:1,title:"p1",body:"b1"){id}}'
curl -XPOST http://vm:8080/graphql -d 'mutation {createComment(user:1,post:1,title:"t1",body:"b1"){id}}'
curl -XPOST http://vm:8080/graphql -d 'mutation {removeComment(id:1)}'
curl -XPOST http://vm:8080/graphql -d 'mutation {removePost(id:1)}'
curl -XPOST http://vm:8080/graphql -d '{user(id:1){post(id:2){title,body}}}'
curl -XPOST http://vm:8080/graphql -d '{user(id:1){posts{id,title,body}}}'
curl -XPOST http://vm:8080/graphql -d '{user(id:1){post(id:2){user{id,email}}}}'
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].