Skip to content

Releases: EntityGraphQL/EntityGraphQL

6.0.0-beta2

01 Dec 22:09

Choose a tag to compare

6.0.0-beta2 Pre-release
Pre-release

Changes

  • Added selectMany method support to filter expressions, enabling flattening using nested collections within queries.

Fixes

  • Fixed (maybe a regression introduced in 6.0.0-beta1) UseFilter() incorrectly adding a default value to the filter argument when applied to fields that already have other arguments defined.

6.0.0-beta1

16 Sep 00:35

Choose a tag to compare

6.0.0-beta1 Pre-release
Pre-release

Breaking Changes

  • Support for partial results as per spec. This actually fixes EntityGraphQL to follow the GraphQL spec regarding partial results. However it does change behavior.

    • EntityGraphQL basically executes each "top level" field in the operation separately, now if any fail, you'll get the partial results of those that succeeded and error information about the failed ones.
    • AddGraphQLValidator now registers IGraphQLValidator as Transient. This was the original intent as the docs have examples of bailing early by checking if the validator has any errors. The intent was errors for that field. This change helps enable partial results. If you want the old behavior, remove the use of AddGraphQLValidator and just add IGraphQLValidator yourself as Scoped
    • As per spec If an error was raised during the execution that prevented a valid response, the "data" entry in the response should be null. This was not always the case
  • Removed methods/properties marked as obsolete

    • IField.UseArgumentsFromField use GetExpressionAndArguments
    • IField.UseArgumentsFrom use GetExpressionAndArguments
    • IField.ResolveWithService use Resolve
    • IFieldExtension.GetExpression use the new GetExpressionAndArguments
  • MapGraphQL followSpec = true is now the default behavior, it follows https://github.com/graphql/graphql-over-http/blob/main/spec/GraphQLOverHTTP.md

  • You can no longer add filter support by using ArgumentHelper.EntityQuery or EntityQueryType in the field args, e.g. schemaProvider.Query().ReplaceField("users", new { filter = ArgumentHelper.EntityQuery<User>() }, "Users optionally filtered"). Please use the UseFilter extension which supports filters referencing service fields.

  • IFieldExtension.GetExpressionAndArguments now takes the current GraphQL node BaseGraphQLField fieldNode as an argument. parentNode has been removed. Access it via fieldNode.ParentNode.

  • EntityGraphQL.AspNet package drops net6.0 and net7.0 as targets. EntityGraphQL package drops net6.0 as a target however as it still targets netstandard2.1 you can still use it with those previous dotnet versions.

Changes

  • Partial results support
  • #467 - New implementation for handling async fields. See updated docs and use the .ResolveAsync<>() methods when adding fields.
  • New support for CancellationToken. A CancellationToken can be passed into the ExecuteRequestAsync method. The token will be checked throughout execution and passed to other async operations. You can use it in .ResolveAsync<MyService, CancellationToken>((context, service, ct) => service.DoSomethingAsync(context.Field, ct)) to pass it to your async fields. If you use MapGraphQL() for ASP.NET it will use the context.RequestAborted as the cancellation token.
  • #469 - Make filter grammar immutable as it should be for performance
  • #303 - You can now reference service fields in the UseFilter/[UseFilter] expression. Like normal the filter will first be applied with non service fields, then applied again with service fields is ExecutionOptions.ExecuteServiceFieldsSeparately == true (default).
  • #396 - Filter expressions now support GraphQL variables using $variableName syntax. This allows parameterized and dynamic filters (e.g., filter: "name == $searchTerm && age > $minAge").
  • Related to #331 and the followSpec = true above, errors and exceptions were refactored internally. Following the GraphQL spec if the core library gets an error it will still return a GraphQLResult with the errors (and potentially partial results).

Fixes

  • #429 Validation attributes now work with [GraphQLInputType]

Full Changelog: 5.7.1...6.0.0-beta1

5.7.1

12 Aug 06:40

Choose a tag to compare

Fixes

  • #466 Include enum-typed input fields in introspection per GraphQL spec

Full Changelog: 5.7.0...5.7.1

5.7.0

06 Aug 11:56

Choose a tag to compare

Changes

  • QueryInfo Support: Added optional query execution information that can be included in the result extensions. Enable with ExecutionOptions.IncludeQueryInfo = true to get metadata about:
    • Operation type (Query, Mutation, Subscription)
    • Operation name
    • Types queried and their selected fields
    • Total number of types and fields queried
    • This is useful for query analysis, debugging, and monitoring GraphQL usage patterns
  • Fix #441 (PR #455) - Have your argument class (including an InputType) class inherit ArgumentsTracker or implement IArgumentsTracker to be able to tell if a variable is just the dotnet default value or is set from the query (variable or inline) with args.IsSet. You can also include IArgumentsTracker as an argument in your mutations etc. This is useful if you method usings simple arguments e.g. MyMutation(Guid id, string name) vs. a [GraphQLArguments] object.
  • #461 - EntityGraphQLEndpointRouteExtensions.MapGraphQL now supports chunked requests
  • RequiredAuthorization is not settable allowing you to change or overwrite it after creation. Also now has Clear() methods to remove authentication

Fixes

  • Throw error on a query that has fragments with a cycle as per the GraphQL spec and to prevent infinite loops.
  • #442 - Fix issue when a service field with a bulk resolver is on a parent field named differently to the dotnet underlying object property

5.6.1

28 Apr 01:20

Choose a tag to compare

Fixes

  • #443 - Allow */* & application/* Accept headers in followSpec option for MapGraphQL
  • #443 - Allow expected headers to not be listed first when using followSpec option for MapGraphQL
  • Better support for multiple items in a single Accept header when using followSpec option for MapGraphQL
  • #449 - Fix issues with self referencing query and connection paging

5.6.0

29 Jan 08:51

Choose a tag to compare

Changes

  • Added additional framework target net9.0
  • ResolveWithService and ResolveWithServices methods are now marked obsolete. Please use Resolve in the same way
  • #430 - MapGraphQL has new parameter followSpec which changes the behavior to follow https://github.com/graphql/graphql-over-http/blob/main/spec/GraphQLOverHTTP.md and is false by default in v5.x. If set to true it will follow the spec, the major change being that if the HTTP request was valid you'll get a 200 status code even if there may be GraphQL errors in the response. Note this will be the default behavior in version v6.
  • Add IsNullable to the IField interface to control setting the nullability of the field return type in the schema

Fixes

  • #435 - fix isAny() in filter
  • Fix issue selecting fields from an object a service field returns where the GraphQL field name differs from the dotnet property name.

Example a field that returns a User type using a service and you are changing the field names in the schema like below

schema.Type<User>().AddField("username", u => u.Name, "Username")
  • #439 - Fix using fields / properties with key words (null, true, false) at the start of the name in the filter expressions
  • Related to #430 - Make sure if the schema says a field is not nullable, that it is not returned as null when using null to exit a mutation or field on error.
  • Fix issue where an expression extracted from a service field may clash with a existing field name

New Contributors

Full Changelog: 5.5.3...5.6.0

5.5.3

24 Nov 23:32

Choose a tag to compare

Fixes

  • #432 - filter expression was incorrectly using bit-wise OR or OrElse

5.5.2

15 Nov 02:42

Choose a tag to compare

Fixes

  • #418 - Fix issue where field expressions using ctx.Entities.FirstOrDefault(<filter>) (First*, Last*, Single* methods with a filter) would duplicate the filter expression on each execution (e.g. making ctx.Entities.Where(<filter>).Where(<filter>).FirstOrDefault()). This also caused EntityFramework not to use it's cache for the expression
  • Fix issue with RequiresAnyRole() being called on a field with multiple roles added them as requiring all those roles vs. any role. This did not effect the [GraphQLAuthorize] attribute

5.5.1

14 Nov 02:11

Choose a tag to compare

Fixes

  • #425 - As per GraphQL Spec, Interfaces are not supported for Input Types
  • #426 - Fix custom directives with no arguments.
  • #427/#428 - Fix issue with connection style paging field extension when using last and before arguments

5.5.0

25 Oct 21:33

Choose a tag to compare

Changes

  • Add IgnoreAttributes to SchemaBuilderOptions - A list of Attribute types which will cause the builder to ignore the field/property when building the schema. These are additional to GraphQLIgnoreAttribute
  • .Resolve<>() method on field changes return type to object? to avoid warnings when returning a valid nullable service call etc.
  • Add support for using a struct type as an object type in the schema, allowing you to query the fields on it. Previously it only worked if you added the struct as a Scalar Type
  • #419 - Add support for using isAny([]) on nullable types

Fixes

  • Make sure top level types have access checked (Query, Mutation and Subscription)
  • Fix #392 - Better handle null checks when executing against in-memory data
  • #363 - Only use ToListWithNullCheck when we know we are executing with services, or have been told not to separate the execution.