graphql

command module
v0.0.0-...-c1c3c3c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2020 License: MIT Imports: 3 Imported by: 0

README

ACNH - GraphQL Server

An open source Animal Crossing New Horizons GraphQL API Server & Endpoint

ACNH - GraphQL is a Animal Crossing New Horizons GraphQL API server. It handles API requests and supports an interactive GraphQL IDE to sample queries.


❗ NOTE ❗

This project is no longer maintained as of 11/04/2020. Please disregard mentions of hosted API server and database update status.

Although this project is not maintained anymore, feel free to fork from this repo and update it for your needs.


Why GraphQL?

I chose GraphQL for several reasons!

  1. I wanted to learn it!
  2. I'm writing an API for all kinds of developers, and I don't know what data they need - graphql handles data selection very well
  3. GraphQL allows me to let you customize options very well (i.e. check out Docs for Filters!)

Ready to get started?

Read the API documentation here!

  • If you're new to GraphQL, I suggest you read all the Doc pages
  • If you've used GraphQL before, you can skip the GraphQL Doc

Table of Contents

Server Database Status

Icon Status
OK
NOT READY
TO BE UPDATED
Table Status Summary
Item Item-related Entries
Wallpaper Wallpaper Entries
Floor Flooring Entries
Clothes Clothing Entries
Music KK Slider Music Entries
Photos Villager Photo Entries
Posters Villager Poster Entries
Rug Rug Entries
Tools Tool Entries
Villager Villager Entries
Bugs Bug Entries
Fishes Fish Entries
Fossils Fossil Entries
Fencing Fence Entries
Umbrellas Umbrellas
Art Art Entries
Construction Construction Project Entries
Nook Miles Nook Miles Options
Reactions Reaction Types
Other Other Misc. Entries

Check issues for detailed descriptions on TO BE UPDATED tables.

Self-Hosting Installation

Want to host the server yourself?

  • Run go get -u github.com/Isabelle-Dev/graphql in terminal
  • Setup PostgreSQL
  • Create and configure .config file using example.config as template
  • Import data using csv files
  • go build -o graphql.exe
  • ./graphql.exe

All csv data files can be found in the csv directory. Postgres migration code (for linux) can be found in csv/linux. csv/master contains the master excel data sheet used for data importation and cleaning.

Sample JSON Responses

Sample JSON responses can be found in the newhorizons/sample directory.

You can also play around with different query options by visiting https://acnhgraphql.com

The endpoint itself renders GraphiQL - a GraphQL IDE.

Documentation

Doc Type Documentation
GraphQL 📖
Queries 📖
Filters 📖
Schema 📖

Example Queries

See Documentation For More Info

query FloorDemo {
  floor {
    query(query: "buy:\"<= 3000 AND > 2000\" color:\"gray AND beige\"", limit: 3) {
      floors {
        Colors
        Catalog
        Concepts
        Sell
        SourceNotes
        Tag
        Image
        VFX
        Buy
        Name
      }
    }
  }
}
query ItemDemo {
  item {
    query(query: " name:\"leaf\" tag:\"plant\" color:\"orange\" ", glob:"t") {
      items {
        Name
        Buy
        Sell
        Concepts
        HHASet
        HHASeries
        Variants {
          Colors
          Pattern
          Image
          Variation
        }
        Tag
      }
    }
  }
}
query ArtDemo {
  art {
    query(query: "buy: \"4980\" tag: \"picture\" ") {
      art {
        Name
        Buy
        Tag
        Category
        Source
        Type {
          Concepts
          Genuine
          Sell
          Image
        }
      }
    }
  }
}

cURL

Example cURL queries can be found at post.json and post.graphql. I do not recommend making graphql requests using pure cURL, but if you must, it's easier to port requests using an external file.

Example cURL With JSON File:

curl -H "Content-Type:application/json" --data @post.json https://acnhgraphql.com

Example cURL With graphql File:

curl -H "Content-Type:application/graphql" --data @post.graphql https://acnhgraphql.com

Contributing

See CONTRIBUTING for more details.

License

Isabelle-Dev graphql server is licensed under the MIT License.

See License for more details.

External Contributions

  • All data is sourced from New Horizons data found here

  • High-resolution image links are provided by Dodo Codes

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package expr - ast.go has the following license: Copyright © 2016 Alan A. A. Donovan & Brian W. Kernighan.
Package expr - ast.go has the following license: Copyright © 2016 Alan A. A. Donovan & Brian W. Kernighan.
art

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL