About the GraphQL API

About GraphQL

The GraphQL data query language is:

  • A specification. The spec determines the validity of the schema on the API server. The schema determines the validity of client calls.

  • Strongly typed. The schema defines an API's type system and all object relationships.

  • Introspective. A client can query the schema for details about the schema.

  • Hierarchical. The shape of a GraphQL call mirrors the shape of the JSON data it returns. Nested fields let you query for and receive only the data you specify in a single round trip.

  • An application layer. GraphQL is not a storage model or a database query language. The graph refers to graph structures defined in the schema, where nodes define objects and edges define relationships between objects. The API traverses and returns application data based on the schema definitions, independent of how the data is stored.

Queries

In this section

About queries

Every GraphQL schema has a root type for both queries and mutations. The query type defines GraphQL operations that retrieve data from the server.

Arguments

Name Description

stationId (Int!)

Station id of the data


Arguments

Name Description

stationId (Int!)

Station id of the data


Arguments

Name Description

stationId (Int!)

Station id of the data


Arguments

Name Description

interval (Int!)

Interval in Days

stationId (Int!)

Station id

limit (Int)

Limit the number of data to be returned

gte (DateTime)

Get data after or equal this time

lte (DateTime)

Get data before or equal this time


Arguments

Name Description

interval (Int!)

Interval in Hours

stationId (Int!)

Station id

limit (Int)

Limit the number of data to be returned

gte (DateTime)

Get data after or equal this time

lte (DateTime)

Get data before or equal this time


Arguments

Name Description

interval (Int!)

Interval in minutes

stationId (Int!)

Station id

limit (Int)

Limit the number of data to be returned

gte (DateTime)

Get data after or equal this time

lte (DateTime)

Get data before or equal this time


Arguments

Name Description

interval (Int!)

Interval in seconds

stationId (Int!)

Station id

limit (Int)

Limit the number of data to be returned

gte (DateTime)

Get data after or equal this time

lte (DateTime)

Get data before or equal this time


Mutations

In this section

About mutations

Every GraphQL schema has a root type for both queries and mutations. The mutation type defines GraphQL operations that change data on the server. It is analogous to performing HTTP verbs such as POST, PATCH, and DELETE.

auth

Type: TokenAuth

Mutation to authenticate a user.

Arguments

Name Description

clientName (String!)

Client name of the user.

loginType (String)

Login type of the user.

password (String!)

Password of the user.

username (String!)

User name.

Return fields

Name Description

result (UserTokenOutput)


insertManyDataDay

Type: InsertDataDayMutation

InsertDataDayMutation description.

Arguments

Name Description

dataDay ([InsertDataInputType]!)

List of data_day to insert

Return fields

Name Description

dataDayInserted ([InsertDataResponseType])


insertManyDataHour

Type: InsertDataHourMutation

InsertDataHourMutation description.

Arguments

Name Description

dataHour ([InsertDataInputType]!)

List of data_hour to insert

Return fields

Name Description

dataHourInserted ([InsertDataResponseType])


insertManyDataMin

Type: InsertDataMinMutation

InsertDataMinMutation description.

Arguments

Name Description

dataMin ([InsertDataInputType]!)

List of data_second to insert

Return fields

Name Description

dataMinInserted ([InsertDataResponseType])


insertManyDataSecond

Type: InsertDataSecondMutation

InsertDataSecondMutation description.

Arguments

Name Description

dataSecond ([InsertDataInputType]!)

List of data_second to insert

Return fields

Name Description

dataSecondInserted ([InsertDataResponseType])


insertManyRawData

Type: InsertRawDataMutation

Insert raw_data mutation.

Arguments

Name Description

rawData ([RawDataInputType]!)

List of raw_data to insert

stationId (Int!)

Station id to insert

Return fields

Name Description

idsInserted ([RawDataResponseType])


startCommand

Type: StartCommandMutation

StartCommandoMutation description.

Arguments

Name Description

stationId (Int!)

Station id of the data

Return fields

Name Description

commandResult (Boolean!)

True if start done well, False if not


stopCommand

Type: StopCommandMutation

StopCommandoMutation description.

Arguments

Name Description

stationId (Int!)

Station id of the data

Return fields

Name Description

commandResult (Boolean!)

True if start done well, False if not


Objects

In this section

About objects

Objects in GraphQL represent the resources you can access. An object can contain a list of fields, which are specifically typed.

GetDataDayResponseType

GetDataDayResponseType description.

Fields

Name Description

dataDayId (String!)

Data day id

createdAt (String!)

Created at

pm1 (Float!)

PM1

pm25 (Float!)

PM25

pm10 (Float!)

PM10

pts (Float!)

PTS


GetDataHourResponseType

GetDataHourResponseType description.

Fields

Name Description

dataHourId (String!)

Data hour id

createdAt (String!)

Created at

pm1 (Float!)

PM1

pm25 (Float!)

PM25

pm10 (Float!)

PM10

pts (Float!)

PTS


GetDataMinResponseType

GetDataMinResponseType description.

Fields

Name Description

dataMinId (String!)

Data Min id

createdAt (String!)

Created at

pm1 (Float!)

PM1

pm25 (Float!)

PM25

pm10 (Float!)

PM10

pts (Float!)

PTS


GetDataSecondResponseType

GetDataSecondResponseType description.

Fields

Name Description

dataSecondId (String!)

Data second id

createdAt (String!)

Created at

pm1 (Float!)

PM1

pm25 (Float!)

PM25

pm10 (Float!)

PM10

pts (Float!)

PTS


InsertDataDayMutation

InsertDataDayMutation description.

Fields

Name Description

dataDayInserted ([InsertDataResponseType])


InsertDataHourMutation

InsertDataHourMutation description.

Fields

Name Description

dataHourInserted ([InsertDataResponseType])


InsertDataMinMutation

InsertDataMinMutation description.

Fields

Name Description

dataMinInserted ([InsertDataResponseType])


InsertDataResponseType

InsertedDataResponse description.

Fields

Name Description

dataId (UUID!)

Data second id

inserted (Boolean!)

True if inserted, False if updated

date (String!)

Date of the data


InsertDataSecondMutation

InsertDataSecondMutation description.

Fields

Name Description

dataSecondInserted ([InsertDataResponseType])


InsertRawDataMutation

Insert raw_data mutation.

Fields

Name Description

idsInserted ([RawDataResponseType])


RawDataResponseType

DataMinType description.

Fields

Name Description

id (Int)

id of the data


StartCommandMutation

StartCommandoMutation description.

Fields

Name Description

commandResult (Boolean!)

True if start done well, False if not


StationData

Station type.

Fields

Name Description

id (String)

name (String)

unit (String)

value (String)

date (String)


StatusCommandDataResponse

Data description.

Fields

Name Description

date (String)

date of the data

pts (Float)

count of pts

pm10 (Float)

count of pm10

pm25 (Float)

count of pm25

pm1 (Float)

count of pm1


StatusCommandMachineResponse

Machine description.

Fields

Name Description

filterUsed (Float)

count min is used to filter

memoryUsed (Float)

count of memory used


StatusCommandPlayResponse

Play description.

Fields

Name Description

play (Boolean)


StopCommandMutation

StopCommandoMutation description.

Fields

Name Description

commandResult (Boolean!)

True if start done well, False if not


TokenAuth

Mutation to authenticate a user.

Fields

Name Description

result (UserTokenOutput)


UserTokenOutput

Input object for the sum service.

Fields

Name Description

token (String!)

Token of the user.

refreshToken (String!)

Refresh token of the user.


Input objects

In this section

About input objects

Input objects can be described as "composable objects" because they include a set of input fields that define the object.

InsertDataInputType

Input object for the data_second.

Input fields

Name Description

stationId (Int!)

Station id of the data

interval (Int!)

Interval of the data

createdAt (DateTime!)

date time of the source data

pm25 (Float)

pm10 (Float)

pts (Float)

pm1 (Float)


RawDataInputType

DataMinType description.

Input fields

Name Description

captureTime (String!)

capture_time of the data

zone (String!)

zone of the data

frecuency (String!)

frecuency of the data

canal1 (String)

canal_1 of the data

canal2 (String)

canal_2 of the data

canal3 (String)

canal_3 of the data

canal4 (String)

canal_4 of the data

canal5 (String)

canal_5 of the data

canal6 (String)

canal_6 of the data

canal7 (String)

canal_7 of the data

canal8 (String)

canal_8 of the data

canal9 (String)

canal_9 of the data

canal10 (String)

canal_10 of the data

canal11 (String)

canal_11 of the data

canal12 (String)

canal_12 of the data

canal13 (String)

canal_13 of the data

canal14 (String)

canal_14 of the data

canal15 (String)

canal_15 of the data

canal16 (String)

canal_16 of the data

canal17 (String)

canal_17 of the data

canal18 (String)

canal_18 of the data

canal19 (String)

canal_19 of the data

canal20 (String)

canal_20 of the data

canal21 (String)

canal_21 of the data

canal22 (String)

canal_22 of the data

canal23 (String)

canal_23 of the data

canal24 (String)

canal_24 of the data

canal25 (String)

canal_25 of the data

canal26 (String)

canal_26 of the data

canal27 (String)

canal_27 of the data

canal28 (String)

canal_28 of the data

canal29 (String)

canal_29 of the data

canal30 (String)

canal_30 of the data


Scalars

In this section

About scalars

Scalars are primitive values: Int, Float, String, Boolean, or ID.

When calling the GraphQL API, you must specify nested subfields until you return only scalars.

Boolean

The Boolean scalar type represents true or false.


DateTime

The DateTime scalar type represents a DateTime value as specified by iso8601.


Float

The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.


Int

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.


String

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.


UUID

Leverages the internal Python implementation of UUID (uuid.UUID) to provide native UUID objects in fields, resolvers and input.