EntityGraphQL

A GraphQL library for .NET

MIT License

Stars
378
Committers
28

Bot releases are visible (Hide)

EntityGraphQL - v3.0.2

Published by lukemurray about 2 years ago

Fixes:

  • InputValue type was being registered under wrong name #184
EntityGraphQL - v3.0.1

Published by lukemurray about 2 years ago

Fixes:

  • #183 Input Types were incorrectly getting field arguments added when using AutoCreateFieldWithIdArguments
EntityGraphQL - v3.0.0

Published by lukemurray about 2 years ago

Breaking changes

  • IDirectiveProcessor now requires a List<ExecutableDirectiveLocation> On { get; } to define where the directive is allowed to be used
  • Removed obsolete ISchemaType.BaseType. Use ISchemaType.BaseTypes
  • Cleaned up SchemaType constructors - using GqlTypeEnum instead of many boolean flags
  • Removed obsolete SchemaProvider.AddInheritedType<TBaseType>
  • Removed the instance parameter from AddMutationsFrom and friends. Mutation "controllers" are now always created per request like an asp.net controller. Use DI for any constructor parameters
  • Renamed ISchemaType.AddBaseType to ISchemaType.Implements to align with GraphQL language
    • ISchemaType.Implements will throw an exception if you try to implement a non-interface
  • Renamed ISchemaType.AddAllBaseTypes to ISchemaType.ImplementAllBaseTypes to align with GraphQL language
  • Create & FromObject on SchemaBuilder now take option classes to configure the create of the schema through reflection
    • ISchemaType.AddAllFields also takes the option class to configure it's behaviour
    • ISchemaType.AddAllFields default behaviour now auto adds any complex types found really reflection the properties & fields and will add those to the schema
  • Added new option when building a schema with SchemaBuilder.FromObject - AutoCreateInterfaceTypes. Defaults to false. If true any abstract classes or interfaces on types reflected with be added as Interfaces in the schema. This is useful if you expose lists of entities on a base/interface type.

Changes

  • ToGraphQLSchemaString now outputs directives in the schema
  • #154 - Dyanmically generated types used in the expressions now include the field name the type is being built for to aid in debugging issues
  • #146 - Allow GraphQL mutation arguments as seperate arguments in the method signature. Avoiding the need to create the mutation argument classes. e.g.
[GraphQLMutation]
public Person AddPersonSeparateArguments(string name, List<string> names, InputObject nameInput, Gender? gender)
{
  // ...
}

[GraphQLMutation]
public Person AddPersonSingleArgument(InputObject nameInput)
{
  // ...
}

Turns into

type Mutation {
  addPersonSeparateArguments(name: String, names: [String!], nameInput: InputObject, gender: Gender): Person
  addPersonSingleArgument(nameInput: InputObject): Person
}
  • #160 - Nested data annotations for validation is now supported
  • Main EntityGraphQL package now targets net6.0;net5.0;netstandard2.1
  • #170 - EntityGraphQL now replaces query context expressions in service fields by matching the expression instance it extracted. This allows for more complex expressions when passing data to a service field
  • Added support for @oneOf Input Types. Mark an input type with GraphQLOneOfAttribute and EntityGraphQL will mark the type with @oneOf in the schema and validate the input meets the requiements on execution

Fixes

  • #171 inheritance support for nested properties / conditional fields
  • #176 - allow fully qualified enums in the filter query language
EntityGraphQL - v2.3.2

Published by lukemurray over 2 years ago

Fixes

  • Fix #159 - SchemaBuilder will no longer try to create schema fields for const fields on mutation args or input types
EntityGraphQL - v2.3.1

Published by lukemurray over 2 years ago

Fixes:

  • #163 - Fix to handle null property in a nested object when processing a System.Text.Json deserialised query document
  • #164 - Fix to support inline fragments in a fragment
  • #166 - Add missing != operator in the fitler expression language and make sure precedence is correct for logic operators
EntityGraphQL - v2.3.0

Published by lukemurray over 2 years ago

Changes:

  • AddMutationsFrom now can use the ServiceProvider instance to create the mutation class allowing dependency injection at the constructor level like Controllers.
  • You can still provide an instance of the mutation class that will be used instead which is the same behaviour as previous, however this method is considered obsolete and will be removed in a future version. We suggest you utilse the ServiceProvider to register your mutation classes with your desired lifetime.
  • Allow types to inherit from multiple base classes/interfaces. Previous ISchemaType.BaseType is obsolete.
  • Cleanup SchemaType to use an enum instead of lots of boolean type variables. Previous constructor is obsolete.
  • Cleanup Interfaces api - added a AddAllBaseTypes, AddBaseType and AddBaseType(string) which provides a lot more flexiblity. See updated docs.
  • Added support for Inline Fragments for types that have interfaces.
  • ToGraphQLSchemaString now orders types and fields by name for consistency regardless of order of fields added and to reduce differences when diffing the schema.

Fixes:

  • Fix #120 - Error when using schema.RemoveTypeAndAllFields and a field of the removing type had a type that has not been added to the schema.
  • Fix #143 - Error building a null check expression in certain cases.