All Versions
252
Latest Version
Avg Release Cycle
21 days
Latest Release
523 days ago

Changelog History
Page 20

  • v1.1.0 Changes

    November 01, 2016

    ๐Ÿ’ฅ Breaking changes

    • Two-character "\\u" is no longer treated as the Unicode escape character, only the Unicode escape character "\u" is treated that way. (This behavior was a bug, the migration path is to use the Unicode escape character.) #366
    • ๐Ÿšš GraphQL::Language::ParserTests was removed, use GraphQL::Compatibility instead. #366
    • 0๏ธโƒฃ Non-null arguments can't be defined with default values, because those values would never be used #361

    ๐Ÿ†• New features

    • Schema.from_definition(definition_string) builds a GraphQL::Schema out of a schema definition. #346
    • Schema members (types, fields, arguments, enum values) can be hidden on a per-query basis with the except: option #300
    • ๐Ÿ— GraphQL::Compatibility contains .build_suite functions for testing user-provided parsers and execution strategies with GraphQL internals. #366
    • Schema members respond to #redefine { ... } for making shallow copies with extended definitions. #357
    • Schema#instrument provides an avenue for observing query and field resolution with no overhead.
    • ๐ŸŽ Some SerialExecution objects were converted to functions, resulting in a modest performance improvement for query resolution.

    ๐Ÿ› Bug fixes

    • NonNullType and ListType have no name (nil), as per the spec #355
    • 0๏ธโƒฃ Non-null arguments can't be defined with default values, because those values would never be used #361
  • v1.0.0 Changes

    October 25, 2016

    ๐Ÿ’ฅ Breaking changes

    • ๐Ÿšš validate: false option removed from Schema.execute (it didn't work anyways) #338
    • ๐Ÿšš Some deprecated methods were removed: #349
      • BaseConnection#object was removed, use BaseConnection#nodes
      • BaseConnection.connection_for_items was removed, use BaseConnection#connection_for_nodes
      • Two-argument resolve functions for Relay::Mutations are not supported, use three arguments instead: (root_obj, input, ctx)
      • Schema.new no longer accepts initialization options, use Schema.define instead
      • GraphQL::ObjectType::UnresolvedTypeError was removed, use GraphQL::UnresolvedTypeError instead
    • โšก๏ธ Fragment type conditions should be parsed as TypeName nodes, not strings. (Users of graphql-libgraphqlparser should update to 1.0.0 of that gem.) #342

    ๐Ÿ†• New Features

    • Set ast_node and irep_node on query context before sending it to middleware #348
    • Enum values can be extended with .define #341

    ๐Ÿ› Bug Fixes

    • ๐Ÿš… Use RelationConnection for Rails 3 relations (which also extend Array) #343
    • ๐Ÿ›  Fix schema printout when arguments have comments #335
  • v0.19.4 Changes

    October 18, 2016

    ๐Ÿ’ฅ Breaking changes

    • ๐Ÿšš Relay::BaseConnection#order was removed (it always returned nil) #313
    • ๐Ÿ“œ In the IDL, Interface names & Union members are parsed as TypeName nodes instead of Strings #322

    ๐Ÿ†• New features

    • ๐Ÿ–จ Print and parse descriptions in the IDL #305
    • Schema roots from IDL are omitted when their names match convention #320
    • Don't add rescue_middleware to a schema if it's not using rescue_from #328
    • Query::Arguments#each_value yields Query::Argument::ArgumentValue instances which contain key, value and argument definition #331

    ๐Ÿ› Bug fixes

    • ๐Ÿ‘‰ Use JSON.generate(val, quirks_mode: true) for compatibility with other JSON implementations #316
    • ๐Ÿ‘Œ Improvements for compatibility with 1.9.3 branch #315 #314 #313
    • Raise a descriptive error when calculating a cursor for a node which isn't present in the connection's members #327
  • v0.19.3 Changes

    October 13, 2016

    ๐Ÿ’ฅ Breaking Changes

    • GraphQL::Query::Arguments.new requires argument_definitions: of type {String => GraphQL::Argument } #304

    ๐Ÿ—„ Deprecations

    • Relay::Mutation#resolve has a new signature. #301

    Previously, it was called with two arguments:

      resolve ->(inputs, ctx) { ... }
    

    Now, it's called with three inputs:

      resolve ->(obj, inputs, ctx) { ... }
    

    obj is the value of root_value: given to Schema#execute, as with other root-level fields.

    Two-argument resolvers are still supported, but they are deprecated and will be removed in a future version.

    ๐Ÿ†• New features

    • Relay::Mutation accepts a user-defined return_type #310
    • Relay::Mutation#resolve receives the root_value passed to Schema#execute #301
    • Derived Relay objects have descriptions #303

    ๐Ÿ› Bug fixes

    • Introspection query is 7 levels deep instead of 3 #308
    • Unknown variable types cause validation errors, not runtime errors #310
    • ๐Ÿ“œ Query::Arguments doesn't wrap hashes from parsed scalars (fix for user-defined "JSONScalar") #304
  • v0.19.2 Changes

    October 06, 2016

    ๐Ÿ†• New features

    • If a list entry has a GraphQL::ExecutionError, replace the entry with nil and return the error #295

    ๐Ÿ› Bug fixes

    • ๐Ÿ‘Œ Support graphql-batch rescuing InvalidNullErrors #296
    • ๐Ÿ–จ Schema printer prints Enum names, not Ruby values for enums #297
  • v0.19.1 Changes

    October 04, 2016

    ๐Ÿ’ฅ Breaking changes

    • ๐Ÿšš Previously-deprecated InterfaceType#resolve_type hook has been removed, use Schema#resolve_type instead #290

    ๐Ÿ†• New features

    • Eager-load schemas at definition time, validating types & schema-level hooks #289
    • InvalidNullErrors contain the type & field name that returned null #293
    • If an object is resolved with Schema#resolve_type and the resulting type is not a member of the expected possible types, raise an error #291

    ๐Ÿ› Bug fixes

    • ๐Ÿ‘ Allow directive as field or argument name #288
  • v0.19.0 Changes

    September 30, 2016

    ๐Ÿ’ฅ Breaking changes

    • ๐Ÿšš GraphQL::Relay::GlobalNodeIdentification was removed. Its features were moved to GraphQL::Schema or GraphQL::Relay::Node. The new hooks support more robust & flexible global IDs. #243

      • Relay's "Node" interface and node(id: "...") field were both moved to GraphQL::Relay::Node. To use them in your schema, call .field and .interface. For example:
      # Adding a Relay-compliant `node` field:
      field :node, GraphQL::Relay::Node.field
      
      # This object type implements Relay's `Node` interface:
      interfaces [GraphQL::Relay::Node.interface]
      
      • UUID hooks were renamed and moved to GraphQL::Schema. You should define id_from_object and object_from_id in your Schema.define { ... } block. For example:
      MySchema = GraphQL::Schema.define do
        # Fetch an object by UUID
        object_from_id ->(id, ctx) {
          MyApp::RelayLookup.find(id)
        }
        # Generate a UUID for this object
        id_from_object ->(obj, type_defn, ctx) {
          MyApp::RelayLookup.to_id(obj)
        }
      end
      
      • The new hooks have no default implementation. To use the previous default, use GraphQL::Schema::UniqueWithinType, for example:
        MySchema = GraphQL::Schema.define do
          object_from_id ->(id, ctx) {
            # Break the id into its parts:
            type_name, object_id = GraphQL::Schema::UniqueWithinType.decode(id)
            # Fetch the identified object
            # ...
          }
      
          id_from_object ->(obj, type_defn, ctx) {
            # Provide the the type name & the object's `id`:
            GraphQL::Schema::UniqueWithinType.encode(type_defn.name, obj.id)
          }
        end
      

      If you were using a custom id_separator, it's now accepted as an input to UniqueWithinType's methods, as separator:. For example:

        # use "---" as a ID separator
        GraphQL::Schema::UniqueWithinType.encode(type_name, object_id, separator: "---")
        GraphQL::Schema::UniqueWithinType.decode(relay_id, separator: "---")
      
      • type_from_object was previously deprecated and has been replaced by Schema#resolve_type. You should define this hook in your schema to return a type definition for a given object:
      MySchema = GraphQL::Schema.define do
        # ...
        resolve_type ->(obj, ctx) {
          # based on `obj` and `ctx`,
          # figure out which GraphQL type to use
          # and return the type
        }
      end
      
      • Schema#node_identification has been removed.
    • 0๏ธโƒฃ Argument default values have been changed to be consistent with InputObjectType default values. #267

    Previously, arguments expected GraphQL values as default_values. Now, they expect application values. (InputObjectTypes always worked this way.)

    Consider an enum like this one, where custom values are provided:

      PowerStateEnum = GraphQL::EnumType.define do
        name "PowerState"
        value("ON", value: 1)
        value("OFF", value: 0)
      end
    

    Previously, enum names were provided as default values, for example:

      field :setPowerState, PowerStateEnum do
        # Previously, the string name went here:
        argument :newValue, default_value: "ON"
      end
    

    Now, enum values are provided as default values, for example:

      field :setPowerState, PowerStateEnum do
        # Now, use the application value as `default_value`:
        argument :newValue, default_value: 1
      end
    

    Note that if you don't have custom values, then there's no change, because the name and value are the same.

    Here are types that are affected by this change:

    • Custom scalars (previously, the default_value was a string, now it should be the application value, eg Date or BigDecimal)
    • Enums with custom value:s (previously, the default_value was the name, now it's the value)

    If you can't replace default_values, you can also use a type's #coerce_input method to translate a GraphQL value into an application value. For example:

      # Using a custom scalar, "Date"
      # PREVIOUSLY, provide a string:
      argument :starts_on, DateType, default_value: "2016-01-01"
      # NOW, transform the string into a Date:
      argument :starts_on, DateType, default_value: DateType.coerce_input("2016-01-01")
    

    ๐Ÿ†• New features

    • ๐Ÿ‘Œ Support @deprecated in the Schema language #275
    • ๐Ÿ‘Œ Support directive definitions in the Schema language #280
    • ๐Ÿ‘‰ Use the same introspection field descriptions as graphql-js #284

    ๐Ÿ› Bug fixes

    • Operation name is no longer present in execution error "path" values #276
    • 0๏ธโƒฃ Default values are correctly dumped & reloaded in the Schema language #267
  • v0.18.15 Changes

    September 20, 2016

    ๐Ÿ’ฅ Breaking changes

    • Validation errors no longer have a "path" key in their JSON. It was renamed to "fields" #264
    • @skip and @include over multiple selections are handled according to the spec: if the same field is selected multiple times and one or more of them would be included, the field will be present in the response. Previously, if one or more of them would be skipped, it was absent from the response. #256

    ๐Ÿ†• New features

    • Execution errors include a "path" key which points to the field in the response where the error occurred. #259
    • ๐Ÿ“œ Parsing directives from the Schema language is now supported #273

    ๐Ÿ› Bug fixes

    • @skip and @include over multiple selections are now handled according to the spec #256
  • v0.18.14 Changes

    September 20, 2016

    ๐Ÿ’ฅ Breaking changes

    • ๐Ÿ’Ž Directives are no longer considered as "conflicts" in query validation. This is in conformity with the spec, but a change for graphql-ruby #263

    ๐Ÿ”‹ Features

    • Query analyzers may emit errors by raising GraphQL::AnalysisErrors during #call or returning a single error or an array of errors from #final_value #262

    ๐Ÿ› Bug fixes

    • ๐Ÿ”€ Merge fields even when @skip / @include are not identical #263
    • ๐Ÿ›  Fix possible infinite loop in FieldsWillMerge validation #261
  • v0.18.13 Changes

    September 19, 2016

    ๐Ÿ› Bug fixes

    • Find infinite loops in nested contexts, too #258