API GraphQL com os dados da câmara de deputados do Brasil
https://dadosabertos.camara.leg.br/swagger/api.html
Install all the dependencies with: yarn
To run the server just run: yarn start:dev
To run the production version of the server already transpiled and without the need of babel-node
, follow these steps.
You just need to run one commend and the transpiled code will be created on ./dist
folder. And run the production code:
yarn start
If you just want to build the production mode you can just run:
yarn build
# List of deputies
query {
deputados (first: 20, after: "MQ==") {
pageInfo {
endCursor
hasNextPage
}
edges {
cursor
node {
id
siglaPartido
urlFoto
}
}
}
}
# Data from one deputy
query {
deputado(id: "178912") {
id
escolaridade
cpf
dataNascimento
nomeCivil
municipioNascimento
}
}
# Expenses of a deputy
query {
deputadoDespesas(id: "178912", after: "MQ==", itens: 15) {
pageInfo {
endCursor
hasNextPage
}
edges {
cursor
node {
ano
valorDocumento
valorLiquido
cnpjCpfFornecedor
dataDocumento
tipoDespesa
urlDocumento
}
}
}
}