Skip to content
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

StrawberryShake Runtime errror deserializing GeoJSONPointType #3685

Closed
ChrisMH opened this issue May 11, 2021 · 2 comments
Closed

StrawberryShake Runtime errror deserializing GeoJSONPointType #3685

ChrisMH opened this issue May 11, 2021 · 2 comments
Labels
⌛ stale Nothing happened with this issue in quite a while 🌶️ strawberry shake
Milestone

Comments

@ChrisMH
Copy link

ChrisMH commented May 11, 2021

Runtime error while deserializing the the 'coordinates' field of a GeoJSONPointType
HC and SS 11.3.0-preview.7

I'm trying to desterilize the 'coordinates' field of a point

fragment currentStatusFields on CurrentStatus {
    position {crs coordinates}
}

I'm getting this error:

The requested operation requires an element of type 'String', but the target element has type 'Array'., code:
   Exception: System.InvalidOperationException: The requested operation requires an element of type 'String', but the target element has type 'Array'

I assume that is because the actual JSON contains an array for the coordinates:

"position":{"__typename":"GeoJSONPointType","crs":4326,"coordinates":[-85.15869,41.12649,0]}

I've tried registering my own Serializer for the 'Position' scalar type (that's the type my schema reports for coordinates):

extend scalar Position
    @runtimeType(name: "global::NetTopologySuite.GeometriesGraph.Position")
    @serializationType(name: "global::System.Array")

However, in that case I get a build error:

Serialization format not supported
@stale
Copy link

stale bot commented May 4, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the ⌛ stale Nothing happened with this issue in quite a while label May 4, 2022
@stale stale bot closed this as completed May 11, 2022
@RobTF
Copy link

RobTF commented Jun 14, 2023

@ChrisMH see #6261 for possible solution to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⌛ stale Nothing happened with this issue in quite a while 🌶️ strawberry shake
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants