GNS-Science/nshm-toshi-api

FIX: Predecessors Invalid Record error

Opened this issue · 0 comments

Current behaviour: When querying Scaled Solution/Time Dependent Solution in TEST environment relay returns error eg:

Warning: RelayResponseNormalizer: Invalid record RmlsZToxMDAwNjk=. Expected __typename to be consistent, but the record was assigned conflicting types Predecessor and File. The GraphQL server likely violated the globally unique id requirement by returning the same id for different objects.

https://relay.dev/docs/debugging/inconsistent-typename-error/

Haven't noticed any impact on TUI client but have had issues in the past with this specific error so could lead to problems in future.

Example query:

  nodes(id_in: [
    "QXV0b21hdGlvblRhc2s6MTAxMTUx",
    "QXV0b21hdGlvblRhc2s6MTAxMTUy"
  ]
) {
    result {
      edges {
        node {
          __typename
          ... on AutomationTask {
            created
            task_type
            id
            files {
              edges {
                node {
                  file {
                    __typename
                    ... on ScaledInversionSolution {
                      id
                      meta {
                        k
                        v
                      }
                      predecessors {
                        __typename
                        pre_id: id
                        relationship
                        depth
                        node {
                          __typename
                          ... on File {
                            file_meta: meta {
                              k
                              v
                            }
                          }
                          ... on InversionSolution {
                            is_meta: meta {
                              k
                              v
                            }
                          }
                          ... on TimeDependentInversionSolution {
                            td_meta: meta {
                              k
                              v
                            }
                          }
                          ... on Node {
                            __isNode: __typename
                            id
                          }
                        }
                        id
                      }
                    }
                    ... on TimeDependentInversionSolution {
                      id
                      meta {
                        k
                        v
                      }
                      predecessors {
                        __typename
                        pre_id: id
                        relationship
                        depth
                        node {
                          __typename
                          ... on File {
                            file_meta: meta {
                              k
                              v
                            }
                          }
                          ... on InversionSolution {
                            is_meta: meta {
                              k
                              v
                            }
                          }
                          ... on TimeDependentInversionSolution {
                            td_meta: meta {
                              k
                              v
                            }
                          }
                          ... on Node {
                            __isNode: __typename
                            id
                          }
                        }
                        id
                      }
                    }
                    ... on Node {
                      __isNode: __typename
                      node_id: id
                      id
                    }
                  }
                }
              }
            }
            inversion_solution {
              id
              file_name
              mfd_table_id
              meta {
                k
                v
              }
              tables {
                table_id
                table_type
              }
            }
          }
          ... on Node {
            __isNode: __typename
            id
          }
        }
      }
    }
  }
}