scaphold-io / scaphold-issues

Post issues that you find on Scaphold here. Post anything about the platform, docs, boilerplates, etc... Happy Scapholding!
3 stars 0 forks source link

Query on connection id incorrect #17

Open baspellis opened 7 years ago

baspellis commented 7 years ago

When I do:

query AllEvents($input: EventWhereArgs) {
  viewer {
    allEvents(where: $input) {
      edges {
        node {
          city {
            id
          }
        }
      }
    }
  }
}

{
  "input": {
    "city": {
      "id": {
        "eq": "3"
      }
    }
  }
}

The response is:

{
  "data": {
    "viewer": {
      "allEvents": {
        "edges": [
          {
            "node": {
              "city": {
                "id": "Q2l0eToz"
              }
            }
          },
          {
            "node": {
              "city": {
                "id": "Q2l0eToz"
              }
            }
          },
          {
            "node": {
              "city": {
                "id": "Q2l0eToz"
              }
            }
          },
          {
            "node": {
              "city": {
                "id": "Q2l0eToz"
              }
            }
          },
          {
            "node": {
              "city": {
                "id": "Q2l0eToz"
              }
            }
          }
        ]
      }
    }
  }
}

The returned id's doesn't comply to id='3'. The query returns the same if I change id='Q2l0eToz' as expected. Is there something special with the id property?

brandonmp commented 7 years ago

scaphold converts base64 ids to string (of the pattern Type:<id#>) before resolving a request. i don't think it checks if the id is base64 or not, so the problem could be that it doesn't recognize integer IDs

that said, the full string of the ID in this instance would be City:3, not just 3, though i don't think that'd work either