Skip to content

Integrate with GraphQL #42

@boardfish

Description

@boardfish

GraphQL could potentially make a lot of RemoteRecord integrations extremely strong. When working on something internally, I ended up with a query like this:

query { 
  nodes(ids: ["sfgsagas", "MDExOlB1bGxSZXF1ZXN0NTcxMDU3NTky"]) {
    ...on PullRequest {
      title
    }
  }
}
{
  "data": {
    "nodes": [
      null,
      [
        [
          "title",
          "Add dot params transformer"
        ]
      ]
    ]
  },
  "errors": [
    {
      "type": "NOT_FOUND",
      "path": [
        "nodes",
        0
      ],
      "locations": [
        {
          "line": 7,
          "column": 3
        }
      ],
      "message": "Could not resolve to a node with the global id of 'sfgsagas'"
    }
  ]
}

This suggests a few things:

  1. It could be possible to grab a variety of objects by ID, and pluck attributes
  2. At least with GitHub's GraphQL API, we can handle failed lookups by compacting the nodes array.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions