Skip to content

Constructs incorrect query when gathering a collection that contains a single object. #28

@abepetrillo

Description

@abepetrillo

Given an ember model:

export default DS.Model.extend({
resources: DS.hasMany('resources', async: true)
});

In the case where resources is [1], the adapter assumes that the graphql api has the singular type available, and you can end up getting an error similar to:

    {"0"=>"Field 'resource' doesn't exist on type 'Query'"}

This means that to make this workable, you need to make sure the API has both the singular and plural way of accessing the resource which can be quite verbose.

Metadata

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