All Versions
116
Latest Version
Avg Release Cycle
-
Latest Release
-

Changelog History
Page 5

  • v0.68.1 Changes

    • โšก๏ธ Update Humanizer.Core dependency which resolves issue with newer dotnet core
  • v0.68.0 Changes

    • ๐Ÿ›  Fix issue where FieldNamer was not being consistently used. Thanks @AnderssonPeter
    • ๐Ÿ‘‰ Make sure we include inner exceptions on errors. Thanks @AnderssonPeter
    • โž• Added string and long parsing for DateTime and DateTimeOffset. Thanks @GravlLift
  • v0.67.0 Changes

    • As per GraphQL spec commas are optional (previously EntityGraphQL expected them in field/mutation arguments)

    ๐Ÿ’ฅ Breaking changes

    • errors property on query result should not be present on the response if there are no errors per the graphQL specification.
  • v0.66.1 Changes

    • ๐Ÿ›  Fix bug with using WithService() when you require the schema context service again to create a link between services
  • v0.66.0 Changes

    • When using services other than the schema context in fields (that return a single object not a Enumerable) the methods/services are no longer executed multiple times. (issue #36). Notes below
    • When a string matches a date time it will be converted to a DateTime object. Useful when using the ArgumentHelper.EntityQuery for advanced filtering. Regex matches "yyyy-MM-dd HH:mm:ss.fffffffzzz", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd" with the separator between date and time being either or T
    • ๐Ÿ‘ EntityQueryCompiler (used in ArgumentHelper.EntityQuery) supports Enums
    • fieldNamer used in mutations too

    ๐Ÿ’ฅ Breaking changes

    • ๐Ÿšš Cleaning up the API. The optional isNullable argument is removed from the AddField() methods. Use IsNullable(bool) method on the Field class or the [GraphQLNotNull] attribute.
    • ๐Ÿšš Cleaning up the API. fieldNamer argument removed from methods in SchemaProvider and SchemaType. Pass in a fieldNamer func to the constructor of SchemaProvider which will be used when it is auto creating fields. If you pass it in via SchemaBuilder.FromObject it will set it on the SchemaProvider created.
    • ๐Ÿšš AddCustomScalarType() removed. Previously marked as obsolete. Use AddScalarType()

    Notes of services fix

    ๐Ÿ— If you build a field like so

    schema.AddField("myField", ctx => WithService((IMyService srv) => srv.DoSomething(ctx)));
    
    // Register the service with DI somewhere
    public class MyService: IMyService {
      public SomeObject DoSomething(Context ctx)
      {
        // do something
        return data;
      }
    }
    

    With a query like

    {
      myField { field1 field 2 }
    }
    

    ๐Ÿ— We use to build an expression like so

    srv.DoSomething(ctx) == null ? null : new {
      field1 = srv.DoSomething(ctx).field1,
      field2 = srv.DoSomething(ctx).field2
    }
    

    We now wrap this in a method call that only calls DoSomething(ctx) a single time Which looks like this

    (ctx, srv) => NullCheckWrapper(srv.DoSomething(ctx), parameterValues, selection); // simplifying here
    
    // Again a simified example of what NullCheckWrapper does
    public object NullCheckWrapper(Expression<Func<Context, IMyService>> baseValue, object[] values, LambdaExpression selection)
    {
      // null check
      if (baseValue == null)
        return null;
      // build the select on the object
      var result = selection.Compile().DynamicInvoke(baseValue);
    }
    

    This works with services used deeper inthe graph too. Example

    schema.Type<Person>().AddField("complexField", (person) => DoSomething(person.Id));
    

    GraphQL

    {
      people {
        complexField {
          field1
          field1
        }
      }
    }
    

    The wrapped expression looks like this

    (ctx, srv) => ctx.People.Select(person => new {
      complexField = NullCheckWrapper(srv.DoSomething(person.Id), parameterValues, selection); // simplifying here
    })
    

    โœ… This has been tested with EF Core and works well.

  • v0.65.0 Changes

    • You can now secure whole types in the schema. Add the [GraphQLAuthorize("claim-name")] to the class or use schema.AddType(...).RequiresAllClaims("some-claim"), schema.AddType(...).RequiresAnyClaim("some-claim")
    • โž• Add GetField(Expression<Func<TBaseType, object>>) overload
    • operation name is optional for a query operation as per GraphQL spec if it is the only operation in the request
    • ๐Ÿ’ฅ Breaking - removed the authorizeClaims argument from AddField(). Please use field.RequiresAllClaims("some-claim"), field.RequiresAnyClaim("some-claim")
  • v0.64.0 Changes

    • ๐Ÿ”„ Change - descriptions generated for a .graphql schema file now use the multiple line triple-quote """
    • ๐Ÿ›  Fix issue where an WithService() expression is wrapped in a UnaryExpression and we fail to get the lambda
  • v0.63.0 Changes

    • ๐Ÿ”ฆ Expose a SchemaProvider.ExecuteQueryAsync()
    • ๐Ÿ›  Fix #53 support mutations with no arguments
    • With the above fix the context and/or the mutation arguments parameters are optional in your mutation method
    • the parameters in the mutation methods are no longer required to follow a position
    • ๐Ÿ—„ SchemaProvider.AddCustomScalarType() is deprecated, use AddScalarType
    • Directvies are now included in schema introspection
    • ๐Ÿ›  Fix #52 - sometimes incorrect types generated for schema intropection or the GraphQL schema file format
    • ๐Ÿ”จ Refactor type information held in the schema. This mean return types etc are evaluated at schema creation time not execution. If you add a field that requires a type as an Arg ument or return type, that type must already be in the schema
    • You can now provide a field namer function to name the generated fields when using SchemaBuilder.FromObject(), ISchemaType.AddAllFields() or SchemaProvider.PopulateFromContext()

    ๐Ÿ’ฅ Breaking changes

    • The class that represents the mutation arguments must be marked with the MutationArgumentsAttribute either at the class level or the parameter
    • ๐Ÿšš SchemaProvider now adds a default Date scalar type in the schema that maps to/from the C# DateTime class. If you were previously adding that you'll get an error on type existing. Use SchemaProvider.RemoveType<DateTime>() to remove it and add it with a different name
    • Type mapping information (AddTypeMapping()) are evaluated at schema creation time. You may need to add mappings before creating the rest of your schema
  • v0.63.0-beta1 Changes

    • โœ‚ Removed the empty IMutationArguments in favor for a MutationArgumentsAttribute on the parameter or the class
  • v0.62.0 Changes

    • ๐Ÿ‘Œ Support async mutation methods