graphql-dotnet / graphql-dotnet/graphql-dotnet

Add Transform(TSourceType source) method to InputObjectGraphType

Open
#4,423 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
6k
Forks
945
Avg merge
3d 13h
Merged PRs (30d)
14

Description

Consider the following input type definition
```c#
public class MyInputGraphType : InputObjectGraphType
{
public MyInputGraphType()
{
Field>("Name");
Field>("Age");
// how to "inject" the Internal?
}
}

public class MyInput
{
public string Name { get; set; }
public int Age { get; set; }
public string Internal { get; set; }
}
```

I want to be able to set the `Internal` property using some internal logic. I know that I can override the `ParseDictionary` but it means I'll have to parse the entire CLR type myself, which I'd prefer to avoid. Something like `Transform(MyInput source)`, which receives a parsed object, would make life much easier.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.