4

GitHub - MatteoLeonesi/GraphQL-Go-onepieceAPI: Basic One Piece (famous manga) AP...

 2 years ago
source link: https://github.com/MatteoLeonesi/GraphQL-Go-onepieceAPI
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

One Piece Api

Basic API developed in Go & GraphQL
68747470733a2f2f692e726564642e69742f79676c3875756d776e707435312e706e67

About The Project

In my opinion the best way to study new techologies is to make projects, so while studying Go and GraphQL i decided to create a basic One Piece (famous manga) API that returns the Strawhats crew information, and give you the possibility to create new crews.

Built With

Getting Started

Start the server :

go run .

Usage

Using GraphQL playground in http://localhost:8080/ (in my case) you can try this Queries and Mutations

  • Get all the strawhats crew
  query findPirates{
  strawhats{
    name
    image
    bounty
    crew
    id
  }
}

Output :


  • Create your crew, adding new pirates
 mutation createPirate {
  createPirate(input: { name: "Marco", pirateId: "1",bounty:" 1.374.000.000",crew:"Whitebeard crew",image:"null"}) {
	  name
	  id
  }
}

Output :


  • Return the created pirates
 query findPirates{
  pirates{
    name
    id
    bounty
    crew
    image //optional
  }
}

Output :


Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again! heart

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

Contact

Matteo Leonesi - Linkedin - [email protected]

Project Link: GraphQL-Go-onepieceAPI

(back to top)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK