Skip to content

Commit

Permalink
common: fix wrongly labled nullable fileds in graphql schema
Browse files Browse the repository at this point in the history
  • Loading branch information
tilacog committed Jul 25, 2023
1 parent f21a460 commit 109a661
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/indexer-common/src/indexer-management/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const SCHEMA_SDL = gql`
transaction: String
failureReason: String
priority: Int
protocolNetwork: String
protocolNetwork: String!
}
input ActionFilter {
Expand Down Expand Up @@ -296,7 +296,7 @@ const SCHEMA_SDL = gql`
type IndexerRegistration {
url: String
protocolNetwork: String
protocolNetwork: String!
address: String
registered: Boolean!
location: GeoLocation
Expand Down Expand Up @@ -416,7 +416,7 @@ const SCHEMA_SDL = gql`
deployment: String!
amount: String!
indexNode: String
protocolNetwork: String
protocolNetwork: String!
): CreateAllocationResult!
closeAllocation(
allocation: String!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const URL_VALIDATION_TEST: Test = {

export default {
indexerRegistration: async (
{ protocolNetwork }: { protocolNetwork: string },
{ protocolNetwork: unvalidateProtocolNetwork }: { protocolNetwork: string },
{ multiNetworks }: IndexerManagementResolverContext,
): Promise<object | null> => {
if (!multiNetworks) {
Expand All @@ -66,17 +66,17 @@ export default {
)
}

const network = extractNetwork(protocolNetwork, multiNetworks)
const network = extractNetwork(unvalidateProtocolNetwork, multiNetworks)
const protocolNetwork = network.specification.networkIdentifier
const address = network.specification.indexerOptions.address
const contracts = network.contracts

const registered = await contracts.serviceRegistry.isRegistered(address)

if (registered) {
const service = await contracts.serviceRegistry.services(address)
return {
address,
protocolNetwork: network.specification.networkIdentifier,
protocolNetwork,
url: service.url,
location: geohash.decode(service.geohash),
registered,
Expand All @@ -87,6 +87,7 @@ export default {
address,
url: null,
registered,
protocolNetwork,
location: null,
__typename: 'IndexerRegistration',
}
Expand Down

0 comments on commit 109a661

Please sign in to comment.