This repository is the code corresponding to the Rocketseat - Ignite, Module: Nftex Project lab by Rafael Camarda.
The project simulates a NFT Art Catalog API that allows to register arts with GraphQL.
Database, we recommends install PostgreSQL with Docker. After that, sets connection configuration at:
config/dev.exs
config/test.exs
cd nftex
mix deps.get
mix ecto.setup
mix test
mix test --cover
mix phx.server
# provides resources graphql
curl -X POST 'http://localhost:4000/api/graphql'
# provides resources graphql with web development interface
curl -X POST 'http://localhost:4000/api/graphiql'
# list all arts
curl -X GET 'http://localhost:4000/api/arts'
# retrieves art
query {
art(id: "15794c31-2b9d-4aeb-aaf2-16eba64b4472") {
artist_name
description
price
hash
}
}
# creates art
mutation {
createArt(input: {
description: "Ixi",
artistName: "Eita",
hash:"13xpto24",
price: 5.4
}) {
id
}
}
# retrieves list of art
query {
arts {
id
artist_name
description
price
hash
}
}