I’m trying to migrate from Newtonsoft.JSON to System.Text.Json for my GraphQL endpoint (in C# using GraphQL.NET)
When I try to serialize the the query result I get this exception when using System.Text.Json:
System.InvalidOperationException: The type 'System.ReadOnlySpan
1[System.Char]’ of property ‘Span’ on type ‘GraphQLParser.ROM’ is invalid for serialization or deserialization because it is a pointer type, is a ref struct, or contains generic parameters that have not been replaced by specific types.`
I was able to Isolate this to the ‘data’ part of my query, but I’m not able to fix it?
Any clue?
I’m not directly using ReadOnlySpan in my code, but my dependencies are.
I works with Newtonsoft.json.