Skip to content

Accomodate "sys" in content queries #245

Open
@rileyjhardy

Description

Currently the gem does not require specifying "sys" within queries such as...

Page.find_by({ meta: { sys: { id: "someid" } } })

However we want to accomodate the case where we do provide "sys" since that is the actual structure of the content type. We don't want the request adding an additional "sys" as in the screenshot below.

wcc-contentful bug

Below is how the Page object structured

{
{
    "metadata": {
        "tags": []
    },
    "sys": {
        "space": {
            "sys": {
                "type": "Link",
                "linkType": "Space",
                "id": "hw5pse7y1ojx"
            }
        },
        "id": "4MLOHjOkA3lBAWz6WPIDQK",
        "type": "Entry",
        "createdAt": "2020-04-29T00:25:26.141Z",
        "updatedAt": "2021-10-14T17:32:19.511Z",
        "environment": {
            "sys": {
                "id": "master",
                "type": "Link",
                "linkType": "Environment"
            }
        },
        "revision": 18,
        "contentType": {
            "sys": {
                "type": "Link",
                "linkType": "ContentType",
                "id": "page"
            }
        },
        "locale": "en-US"
    }...

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions