Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 615 Bytes

README.md

File metadata and controls

26 lines (21 loc) · 615 Bytes

GraphQL.Maybe

NuGet version (GraphQL.Maybe)

The GraphQL.Maybe type can be used to represent non-nullable graphql fields as optional fields in C#

type User {
  id: Int!
  username: String!
  email: String
  age: Int
}
public class User 
{
  int Id { get; set; }
  string Username { get; set; }
  Maybe<string> Email { get; set; }
  Maybe<int> Age { get; set; }
}

JSON custom converters will only pass fields that are either non-optional or have a value assigned.