Skip to content

[oData Handler] Implementation of calling an single entity is not correct #3770

Open
@chrisweirich

Description

@chrisweirich

When a single entity is called, the odata service is not called according to the specified odata protocol. With very strict odata services (e.g. SAP) this leads to errors.

Protocol: https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_Entity

http://host/service/Customers(1)

Implementation graphql mesh odata handler

http://host/service/Customers/1/

Suggestion
https://github.com/Urigo/graphql-mesh/blob/master/packages/handlers/odata/src/index.ts#L441

        function addIdentifierToUrl(url, identifierFieldName, identifierFieldTypeRef, args) {
            // Only round brackets are allowed and a string must be surrounded with '
            url.href += (typeof args[identifierFieldName] === 'string') ? `('${args[identifierFieldName]}')` : `(${args[identifierFieldName]})`;
        }

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