Skip to content

Filling all fields #29

@eunjae-lee

Description

@eunjae-lee

When some fields are empty on a certain row, the api result from airtable doesn't include the field in that row.

image

{
  "records": [
    {
      "id": "recR4fJQsMlpWyy5A",
      "fields": {
        "Name": "John"
      },
      "createdTime": "2018-12-30T07:10:11.000Z"
    },
    {
      "id": "recoqit7jOBr8m6JK",
      "fields": {
        "Name": "Michael",
        "Notes": "Note1"
      },
      "createdTime": "2018-12-30T07:10:11.000Z"
    }
  ]
}

You can see "Notes" field is missing at the first row. Could we have a fields option?

    {
      resolve: 'gatsby-source-airtable',
      options: {
        apiKey: 'xxx',
        tables: [
          {
            baseId: 'xxx',
            tableName: 'xxx',
            tableView: 'xxx',
            fields: ['Name', 'Notes']
          },
        ],
      },
    }

When fields is specified, the result will always include all the fields with null as default value if none.
This is to prevent graphql query from failing. Refer to gatsbyjs/gatsby#2392

What do you think?

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