这是indexloc提供的服务,不要输入任何密码
Skip to content

v1.7.0

Compare
Choose a tag to compare
@github-actions github-actions released this 10 Mar 21:42
· 21 commits to main since this release

Added

  • Add uuid scalar type (#148)

Changed

  • On database introspection newly-added collection fields will be added to existing schema configurations (#152)

Fixed

  • Update dependencies to get fixes for reported security vulnerabilities (#149)

Changes to database introspection

Previously running introspection would not update existing schema definitions, it would only add definitions for
newly-added collections. This release changes that behavior to make conservative changes to existing definitions:

  • added fields, either top-level or nested, will be added to existing schema definitions
  • types for fields that are already configured will not be changed automatically
  • fields that appear to have been added to collections will not be removed from configurations

We take such a conservative approach to schema configuration changes because we want to avoid accidental breaking API
changes, and because schema configuration can be edited by hand, and we don't want to accidentally reverse such
modifications.

If you want to make type changes to fields that are already configured, or if you want to remove fields from schema
configuration you can either make those edits to schema configurations by hand, or you can delete schema files before
running introspection.

UUID scalar type

Previously UUID values would show up in GraphQL as BinData. BinData is a generalized BSON type for binary data. It
doesn't provide a great interface for working with UUIDs because binary data must be given as a JSON object with binary
data in base64-encoding (while UUIDs are usually given in a specific hex-encoded string format), and there is also
a mandatory "subtype" field. For example a BinData value representing a UUID fetched via GraphQL looks like this:

{ "base64": "QKaT0MAKQl2vXFNeN/3+nA==", "subType":"04" }

With this change UUID fields can use the new uuid type instead of binData. Values of type uuid are represented in
JSON as strings. The same value in a field with type uuid looks like this:

"40a693d0-c00a-425d-af5c-535e37fdfe9c"

This means that you can now, for example, filter using string representations for UUIDs:

query {
  posts(where: {id: {_eq: "40a693d0-c00a-425d-af5c-535e37fdfe9c"}}) {
    title
  }
}

Introspection has been updated so that database fields containing UUIDs will use the uuid type when setting up new
collections, or when re-introspecting after deleting the existing schema configuration. For migrating you may delete and
re-introspect, or edit schema files to change occurrences of binData to uuid.

Security Fixes

Rust dependencies have been updated to get fixes for these advisories: