Coder Social home page Coder Social logo

go-graphql's Introduction

GraphQL GO using GQLGEN ๐Ÿ‘‹

Version Twitter: felix_fernand0

Example go graphql using library gqlgen

๐Ÿ  Homepage

โœจ Playground

Installation

create .env file
DATA_SOURCE="your-database-source"
PORT=8080
GOLANG_ENV="test"

Test

make test

Usage

go run server.go

Linter

make check

Fix Linter

make format

GraphQL Features

๐Ÿ’ก Request Header

{
  "Authorization":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NzA2NzI0MjQsImlzcyI6Impob24iLCJVc2VySUQiOjgxLCJVc2VybmFtZSI6ImZlbGl4IiwiTmFtZSI6IkZlbGl4IiwiSXNBZG1pbiI6dHJ1ZSwiRXhwaXJlc0F0IjoxNjcwNjcyNDI0fQ.noKdYN3fhr7iwQmlDy1xYn1FqLsZ4gY-ORkWf3oeP_I"
}

๐Ÿ’ก Query

  • Login get token
query login {
  login(input: {username: "felix", password: "felix"}) {
    success
    message
    token
  }
}
  • Show all data pokemon (limit, offset, sort)
query pokemons {
  pokemons {
    id
    height
    name
  }
}
  • Show data pokemon by ID
query pokemon {
  pokemon(pokemonID: 1) {
    name
    types {
      id
    }
    height
    weight
  }
}

๐Ÿ’ก Mutation

  • Update Pokemon
mutation update{
  updatePokemon(input:{id: 1}){
    success
    pokemon{id}
  }
}
  • Delete Pokemon
mutation delete {
  deletePokemon(input:{id:11}){
    success
  }
}

Author

๐Ÿ‘ค Felix Fernando

๐Ÿค Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a โญ๏ธ if this project helped you!


This README was generated with โค๏ธ by readme-md-generator

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.