FSharp.Data.GraphQL icon indicating copy to clipboard operation
FSharp.Data.GraphQL copied to clipboard

Fix recursive definition of InputObject fields

Open vanhoeij opened this issue 4 years ago • 5 comments

Using recursive definition of fields in the InputObject resulted in a null reference exception. The exception was triggered because the ExecuteInput on a field definition was not initialized. It was caused by not caching the field definitions correctly, resulting in uninitialized field definitions to be used.

In this PR, the function that is used to retrieve the definitions is wrapped inside a lazy, which makes sure that always the same field definitions are returned.

ps. it was required to update the dependencies because MSBuild.StructuredLogger was causing an issue when restoring the client project.

vanhoeij avatar Sep 21 '21 06:09 vanhoeij

@mickhansen, @nikhedonia any comments about this one?

xperiandri avatar May 19 '22 18:05 xperiandri

@vanhoeij

xperiandri avatar Oct 07 '22 22:10 xperiandri

@vanhoeij

xperiandri avatar Oct 07 '22 22:10 xperiandri

@njlr what do you think?

xperiandri avatar Oct 07 '22 22:10 xperiandri

@njlr what do you think?

This change makes sense to me.

Good to fix the typos also :+1:

njlr avatar Oct 08 '22 15:10 njlr

@vanhoeij will you rebase? Or give me access to your repo

xperiandri avatar Nov 27 '22 01:11 xperiandri

@vanhoeij thank you very much for your contribution!

xperiandri avatar Dec 05 '22 22:12 xperiandri

@vanhoeij

Error Message:
   expected { fieldWithNestedInputObject: "{"na":{"a":null,"b":null,"c":"c","d":null},"nb":"b"}" }
    but got { fieldWithNestedInputObject: "{"na":{"a":null,"b":null,"c":"c","d":null,"e":null},"nb":"b"}" }

xperiandri avatar Dec 05 '22 22:12 xperiandri

Is the fix as simple as adding ,"e":null?

xperiandri avatar Dec 05 '22 22:12 xperiandri