Skip to content

ignite - module: nftex project from rocketseat by Rafael Camarda

Notifications You must be signed in to change notification settings

raulpe7eira/nftex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nftex API

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.

Previous installations

Database, we recommends install PostgreSQL with Docker. After that, sets connection configuration at:

  • config/dev.exs
  • config/test.exs

Gets dependencies, setups database, tests, coverages, reports and starts application

cd nftex
mix deps.get
mix ecto.setup
mix test
mix test --cover
mix phx.server

How to use?

# 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'

Resources GraphQL

# 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
  }
}

About

ignite - module: nftex project from rocketseat by Rafael Camarda

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages