Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swapped Apollo Client with graph-client #892

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
738 changes: 738 additions & 0 deletions .graphclient/index.ts

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .graphclient/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"mesh-artifacts","private":true,"type":"commonjs","main":"index.js","module":"index.mjs","sideEffects":false,"typings":"index.d.ts","typescript":{"definition":"index.d.ts"},"exports":{".":{"require":"./index.js","import":"./index.mjs"},"./*":{"require":"./*.js","import":"./*.mjs"}}}
371 changes: 371 additions & 0 deletions .graphclient/schema.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,371 @@
schema {
query: Query
subscription: Subscription
}

"""
Marks the GraphQL type as indexable entity. Each type that should be an entity is required to be annotated with this directive.
"""
directive @entity on OBJECT

"""Defined a Subgraph ID for an object type"""
directive @subgraphId(id: String!) on OBJECT

"""
creates a virtual field on the entity that may be queried but cannot be set manually through the mappings API.
"""
directive @derivedFrom(field: String!) on FIELD_DEFINITION

scalar BigDecimal

scalar BigInt

input BlockChangedFilter {
number_gte: Int!
}

input Block_height {
hash: Bytes
number: Int
number_gte: Int
}

scalar Bytes

type Greeting {
id: ID!
sender: Sender!
greeting: String!
premium: Boolean
value: BigInt
createdAt: BigInt!
transactionHash: String!
}

input Greeting_filter {
id: ID
id_not: ID
id_gt: ID
id_lt: ID
id_gte: ID
id_lte: ID
id_in: [ID!]
id_not_in: [ID!]
sender: String
sender_not: String
sender_gt: String
sender_lt: String
sender_gte: String
sender_lte: String
sender_in: [String!]
sender_not_in: [String!]
sender_contains: String
sender_contains_nocase: String
sender_not_contains: String
sender_not_contains_nocase: String
sender_starts_with: String
sender_starts_with_nocase: String
sender_not_starts_with: String
sender_not_starts_with_nocase: String
sender_ends_with: String
sender_ends_with_nocase: String
sender_not_ends_with: String
sender_not_ends_with_nocase: String
sender_: Sender_filter
greeting: String
greeting_not: String
greeting_gt: String
greeting_lt: String
greeting_gte: String
greeting_lte: String
greeting_in: [String!]
greeting_not_in: [String!]
greeting_contains: String
greeting_contains_nocase: String
greeting_not_contains: String
greeting_not_contains_nocase: String
greeting_starts_with: String
greeting_starts_with_nocase: String
greeting_not_starts_with: String
greeting_not_starts_with_nocase: String
greeting_ends_with: String
greeting_ends_with_nocase: String
greeting_not_ends_with: String
greeting_not_ends_with_nocase: String
premium: Boolean
premium_not: Boolean
premium_in: [Boolean!]
premium_not_in: [Boolean!]
value: BigInt
value_not: BigInt
value_gt: BigInt
value_lt: BigInt
value_gte: BigInt
value_lte: BigInt
value_in: [BigInt!]
value_not_in: [BigInt!]
createdAt: BigInt
createdAt_not: BigInt
createdAt_gt: BigInt
createdAt_lt: BigInt
createdAt_gte: BigInt
createdAt_lte: BigInt
createdAt_in: [BigInt!]
createdAt_not_in: [BigInt!]
transactionHash: String
transactionHash_not: String
transactionHash_gt: String
transactionHash_lt: String
transactionHash_gte: String
transactionHash_lte: String
transactionHash_in: [String!]
transactionHash_not_in: [String!]
transactionHash_contains: String
transactionHash_contains_nocase: String
transactionHash_not_contains: String
transactionHash_not_contains_nocase: String
transactionHash_starts_with: String
transactionHash_starts_with_nocase: String
transactionHash_not_starts_with: String
transactionHash_not_starts_with_nocase: String
transactionHash_ends_with: String
transactionHash_ends_with_nocase: String
transactionHash_not_ends_with: String
transactionHash_not_ends_with_nocase: String
"""Filter for the block changed event."""
_change_block: BlockChangedFilter
and: [Greeting_filter]
or: [Greeting_filter]
}

enum Greeting_orderBy {
id
sender
sender__id
sender__address
sender__createdAt
sender__greetingCount
greeting
premium
value
createdAt
transactionHash
}

"""
8 bytes signed integer

"""
scalar Int8

"""Defines the order direction, either ascending or descending"""
enum OrderDirection {
asc
desc
}

type Query {
greeting(
id: ID!
"""
The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.
"""
block: Block_height
"""
Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.
"""
subgraphError: _SubgraphErrorPolicy_! = deny
): Greeting
greetings(
skip: Int = 0
first: Int = 100
orderBy: Greeting_orderBy
orderDirection: OrderDirection
where: Greeting_filter
"""
The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.
"""
block: Block_height
"""
Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.
"""
subgraphError: _SubgraphErrorPolicy_! = deny
): [Greeting!]!
sender(
id: ID!
"""
The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.
"""
block: Block_height
"""
Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.
"""
subgraphError: _SubgraphErrorPolicy_! = deny
): Sender
senders(
skip: Int = 0
first: Int = 100
orderBy: Sender_orderBy
orderDirection: OrderDirection
where: Sender_filter
"""
The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.
"""
block: Block_height
"""
Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.
"""
subgraphError: _SubgraphErrorPolicy_! = deny
): [Sender!]!
"""Access to subgraph metadata"""
_meta(block: Block_height): _Meta_
}

type Sender {
id: ID!
address: Bytes!
greetings(skip: Int = 0, first: Int = 100, orderBy: Greeting_orderBy, orderDirection: OrderDirection, where: Greeting_filter): [Greeting!]
createdAt: BigInt!
greetingCount: BigInt!
}

input Sender_filter {
id: ID
id_not: ID
id_gt: ID
id_lt: ID
id_gte: ID
id_lte: ID
id_in: [ID!]
id_not_in: [ID!]
address: Bytes
address_not: Bytes
address_gt: Bytes
address_lt: Bytes
address_gte: Bytes
address_lte: Bytes
address_in: [Bytes!]
address_not_in: [Bytes!]
address_contains: Bytes
address_not_contains: Bytes
greetings_: Greeting_filter
createdAt: BigInt
createdAt_not: BigInt
createdAt_gt: BigInt
createdAt_lt: BigInt
createdAt_gte: BigInt
createdAt_lte: BigInt
createdAt_in: [BigInt!]
createdAt_not_in: [BigInt!]
greetingCount: BigInt
greetingCount_not: BigInt
greetingCount_gt: BigInt
greetingCount_lt: BigInt
greetingCount_gte: BigInt
greetingCount_lte: BigInt
greetingCount_in: [BigInt!]
greetingCount_not_in: [BigInt!]
"""Filter for the block changed event."""
_change_block: BlockChangedFilter
and: [Sender_filter]
or: [Sender_filter]
}

enum Sender_orderBy {
id
address
greetings
createdAt
greetingCount
}

type Subscription {
greeting(
id: ID!
"""
The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.
"""
block: Block_height
"""
Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.
"""
subgraphError: _SubgraphErrorPolicy_! = deny
): Greeting
greetings(
skip: Int = 0
first: Int = 100
orderBy: Greeting_orderBy
orderDirection: OrderDirection
where: Greeting_filter
"""
The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.
"""
block: Block_height
"""
Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.
"""
subgraphError: _SubgraphErrorPolicy_! = deny
): [Greeting!]!
sender(
id: ID!
"""
The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.
"""
block: Block_height
"""
Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.
"""
subgraphError: _SubgraphErrorPolicy_! = deny
): Sender
senders(
skip: Int = 0
first: Int = 100
orderBy: Sender_orderBy
orderDirection: OrderDirection
where: Sender_filter
"""
The block at which the query should be executed. Can either be a `{ hash: Bytes }` value containing a block hash, a `{ number: Int }` containing the block number, or a `{ number_gte: Int }` containing the minimum block number. In the case of `number_gte`, the query will be executed on the latest block only if the subgraph has progressed to or past the minimum block number. Defaults to the latest block when omitted.
"""
block: Block_height
"""
Set to `allow` to receive data even if the subgraph has skipped over errors while syncing.
"""
subgraphError: _SubgraphErrorPolicy_! = deny
): [Sender!]!
"""Access to subgraph metadata"""
_meta(block: Block_height): _Meta_
}

type _Block_ {
"""The hash of the block"""
hash: Bytes
"""The block number"""
number: Int!
"""Integer representation of the timestamp stored in blocks for the chain"""
timestamp: Int
}

"""The type for the top-level _meta field"""
type _Meta_ {
"""
Information about a specific subgraph block. The hash of the block
will be null if the _meta field has a block constraint that asks for
a block number. It will be filled if the _meta field has no block constraint
and therefore asks for the latest block

"""
block: _Block_!
"""The deployment ID"""
deployment: String!
"""If `true`, the subgraph encountered indexing errors at some past block"""
hasIndexingErrors: Boolean!
}

enum _SubgraphErrorPolicy_ {
"""Data will be returned even if the subgraph has indexing errors"""
allow
"""
If the subgraph has indexing errors, data will be omitted. The default.
"""
deny
}
Loading