GitHub - MatteoLeonesi/GraphQL-Go-onepieceAPI: Basic One Piece (famous manga) AP...
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.
One Piece Api
Basic API developed in Go & GraphQLAbout 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!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Contact
Matteo Leonesi - Linkedin - [email protected]
Project Link: GraphQL-Go-onepieceAPI
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK