graphprotocol / graph-client

The Graph library for building GraphQL-based dapps in a decentralized way.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting "Cannot return null for non-nullable field"

witherblock opened this issue · comments

Happening here: https://github.com/dopex-io/elvarg/pull/483

.graphclientrc.yml: https://github.com/dopex-io/elvarg/blob/feat/graphclient/apps/dapp/.graphclientrc.yml

Error:
Screenshot 2023-04-04 at 12 01 12 AM

Works fine on thegraph site: https://api.thegraph.com/subgraphs/name/psytama/dopex-ssov/graphql?query=%7B%0A++users+%7B%0A++++id%0A++++userPositions+%7B%0A++++++id%0A++++++epoch%0A++++++strike%0A++++++amount%0A++++%7D%0A++++userSSOVDeposit+%7B%0A++++++id%0A++++++transaction+%7B%0A++++++++id%0A++++++%7D%0A++++++user+%7B%0A++++++++id%0A++++++%7D%0A++++++sender%0A++++++epoch%0A++++++strike%0A++++++amount%0A++++++ssov+%7B%0A++++++++id%0A++++++%7D%0A++++%7D%0A++++userSSOVOptionBalance+%7B%0A++++++id%0A++++++transaction+%7B%0A++++++++id%0A++++++%7D%0A++++++epoch%0A++++++strike%0A++++++user+%7B%0A++++++++id%0A++++++%7D%0A++++++sender%0A++++++amount%0A++++++fee%0A++++++premium%0A++++++ssov+%7B%0A++++++++id%0A++++++%7D%0A++++%7D%0A++%7D%0A%7D%0A++++%23%0A++++%23+Welcome+to+The+GraphiQL%0A++++%23%0A++++%23+GraphiQL+is+an+in-browser+tool+for+writing%2C+validating%2C+and%0A++++%23+testing+GraphQL+queries.%0A++++%23%0A++++%23+Type+queries+into+this+side+of+the+screen%2C+and+you+will+see+intelligent%0A++++%23+typeaheads+aware+of+the+current+GraphQL+type+schema+and+live+syntax+and%0A++++%23+validation+errors+highlighted+within+the+text.%0A++++%23%0A++++%23+GraphQL+queries+typically+start+with+a+%22%7B%22+character.+Lines+that+start%0A++++%23+with+a+%23+are+ignored.%0A++++%23%0A++++%23+An+example+GraphQL+query+might+look+like%3A%0A++++%23%0A++++%23+++++%7B%0A++++%23+++++++field%28arg%3A+%22value%22%29+%7B%0A++++%23+++++++++subField%0A++++%23+++++++%7D%0A++++%23+++++%7D%0A++++%23%0A++++%23+Keyboard+shortcuts%3A%0A++++%23%0A++++%23++Prettify+Query%3A++Shift-Ctrl-P+%28or+press+the+prettify+button+above%29%0A++++%23%0A++++%23+++++Merge+Query%3A++Shift-Ctrl-M+%28or+press+the+merge+button+above%29%0A++++%23%0A++++%23+++++++Run+Query%3A++Ctrl-Enter+%28or+press+the+play+button+above%29%0A++++%23%0A++++%23+++Auto+Complete%3A++Ctrl-Space+%28or+just+start+typing%29%0A++++%23%0A++

Query:

{
  users {
    id
    userPositions {
      id
      epoch
      strike
      amount
    }
    userSSOVDeposit {
      id
      transaction {
        id
      }
      user {
        id
      }
      sender
      epoch
      strike
      amount
      ssov {
        id
      }
    }
    userSSOVOptionBalance {
      id
      transaction {
        id
      }
      epoch
      strike
      user {
        id
      }
      sender
      amount
      fee
      premium
      ssov {
        id
      }
    }
  }
}

Let me know if I can add any additional info.

Figured out the issue, was happening due to conflicting entity types. Closing this, sorry for causing any inconvenience.