nation3 / agreements-app

App to interact with the Nation3 Agreements smart contracts
https://agreements.nation3.org
GNU General Public License v3.0
7 stars 10 forks source link

HTTP 500 when loading agreements for a user (Sepolia) #155

Open aahna-ashina opened 6 months ago

aahna-ashina commented 6 months ago

Getting an HTTP 500 Internal Server Error when opening https://agreements-sepolia.nation3.org/agreements

GET https://agreements-sepolia.nation3.org/api/11155111/agreements/0x4e3072f7b5C075EA5FdEb423DA95312C4B99dc22 500 (Internal Server Error)

Response:

{"message":"Internal server error on agreements fetching"}

Vercel log output: https://github.com/nation3/agreements-app/issues/155#issuecomment-1978091188

aahna-ashina commented 6 months ago

Vercel log output:

ClientError: Type `AgreementPosition` has no field `collateral`: {"response":{"errors":[{"locations":[{"line":5,"column":25}],"message":"Type `AgreementPosition` has no field `collateral`"}],"status":200,"headers":{}},"request":{"query":"\n\tquery GetUserAgreements($account: Bytes!) {\n\t\tagreementPositions(where: { party: $account }) {\n\t\t\tparty\n\t\t\tcollateral\n\t\t\tstatus\n\t\t\tagreement {\n\t\t\t\tid\n\t\t\t\tmetadataURI\n\t\t\t\tcreatedAt\n\t\t\t\tstatus\n\t\t\t\ttoken\n\t\t\t}\n\t\t}\n\t}\n","variables":{"account":"0x4e3072f7b5C075EA5FdEb423DA95312C4B99dc22"}}}
    at makeRequest (file:///var/task/node_modules/graphql-request/build/esm/index.js:283:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async handler (/var/task/packages/web-app/.next/server/pages/api/[chain]/agreements/[account].js:168:22) {
  response: {
    errors: [ [Object] ],
    status: 200,
    headers: Headers { [Symbol(map)]: [Object: null prototype] }
  },
  request: {
    query: '\n' +
      '\tquery GetUserAgreements($account: Bytes!) {\n' +
      '\t\tagreementPositions(where: { party: $account }) {\n' +
      '\t\t\tparty\n' +
      '\t\t\tcollateral\n' +
      '\t\t\tstatus\n' +
      '\t\t\tagreement {\n' +
      '\t\t\t\tid\n' +
      '\t\t\t\tmetadataURI\n' +
      '\t\t\t\tcreatedAt\n' +
      '\t\t\t\tstatus\n' +
      '\t\t\t\ttoken\n' +
      '\t\t\t}\n' +
      '\t\t}\n' +
      '\t}\n',
    variables: { account: '0x4e3072f7b5C075EA5FdEb423DA95312C4B99dc22' }
  }
}