-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OData Handler] Add default filter param of ID for all queries on collections when talking to Microsoft Graph #787
Comments
There might be primary keys with different names other than (id) and I also think people can extend their OData schema with singletons to get single object instead of arrays(entityset). Maybe we should leave this as it is now because you are able to extend the schema using additionalTypeDefs and additionalResolvers in Mesh for more cases. Other than that, we can improve queryOptions to have stronger typings instead of passing a string statement like "id eq Foo" not only for primary keys but also all other queryable fields. What do you think? |
@ardatan thanks and I can see the concern. in Graph we have more uniform guidelines and strive for consistency. Granted we are not the only feed. :-) The CSDL should indicate which property is the entity id right? So couldn’t you determine based on the entity which prop to add? Maybe it is not part of QueryParams but loose. I agree that you should not block things supported by the spec. Also agree that having the ability to specify more props to filter on is good. The entityid though has some special treatment as in the url I displayed. Also it may make sense to have config switches to allow certain behavior to be turned on or off. Thoughts? |
@ardatan just looking through our Graph $metadata, for Microsoft Graph all entities ultimately derive from From the metadata <EntityType Name="entity" Abstract="true">
<Key>
<PropertyRef Name="id" />
</Key>
<Property Name="id" Type="Edm.String" Nullable="false" />
</EntityType> |
@ardatan I updated the description to make it Graph-specific |
@glennblock Available in @graphql-mesh/odata@0.5.1 ! |
This would be fantastic. Something like how Hasura allows for filtering, it would be great if GraphQL Mesh could have typed filtering. eg
Which would resolve to |
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Every entity in OData carries a unique Entity ID. In Graph we also have a default
id
property on every entity. When querying against a collection, the id can be used in the url as part of the path. Currently there is no way to filter on the id other than using theFilter
property onQueryOptions
. Without having id first class, I cannot currently create a request to with the following urlshttps://graph.microsoft.com/v1.0/me/drive/items/F8B2FD72406FB218!6801/versions
or
https://graph.microsoft.com/v1.0/me/drive/items('F8B2FD72406FB218!6801')/versions
If id is added as a first class param and implemented such that the id is used in the path (using either of the two approaches) then I could use the following GraphQL query to get that url
Adding this behavior would enhance overall drill down with GraphQL on OData feeds.
The text was updated successfully, but these errors were encountered: