public void ParseValue_ValueIsSimpleInput() { // arrange ISchema schema = SchemaBuilder.New() .AddQueryType(c => c .Name("Query") .Field("foo") .Type <StringType>() .Resolver("bar")) .AddType(new InputObjectType <SimpleInput>(d => d .Ignore(t => t.Id))) .Create(); InputObjectType type = schema.GetType <InputObjectType>("SimpleInput"); // act IValueNode valueNode = type.ParseValue( new SimpleInput { Id = 1, Name = "foo" }); // assert valueNode.Print().MatchSnapshot(); }
private static string SerializeValue(IValueNode value) { if (value is ScopedVariableNode variable) { return($"${variable.Scope.Value}:{variable.Name.Value}"); } return(value.Print()); }