Detalhes do pacote

graphql-parse-resolve-info

graphile693.3kMIT4.13.0

Parse GraphQLResolveInfo (the 4th argument of resolve) into a simple tree

graphile, graphql, engine, resolveinfo

readme (leia-me)

graphql-parse-resolve-info

Patreon sponsor button Discord chat room Package on npm MIT license Follow

Parses a GraphQLResolveInfo object into a tree of the fields that are being requested to enable optimisations to your GraphQL schema (e.g. to determine which fields are required from the backend).

Useful for optimising your GraphQL resolvers by allowing them to look ahead in the request, reducing the number of SQL queries or HTTP requests required to complete the GraphQL request.

Also provides a quick way to get the alias of the current field being resolved.

Crowd-funded open-source software

To help us develop this software sustainably under the MIT license, we ask all individuals and businesses that use it to help support its ongoing maintenance and development via sponsorship.

Click here to find out more about sponsors and sponsorship.

And please give some love to our featured sponsors 🤩:

Surge
Surge
Netflix
Netflix
Qwick
Qwick
The Guild
The Guild
Chad Furman
Chad Furman
Fanatics
Fanatics
Dovetail
Dovetail
Enzuzo
Enzuzo
Stellate
Stellate
*

* Sponsors the entire Graphile suite

API

parseResolveInfo(resolveInfo)

Alias: parse

Gets the tree of subfields of the current field that is being requested, returning the following properties (recursively):

  • name: the name of the GraphQL field
  • alias: the alias this GraphQL field has been requested as, or if no alias was specified then the name
  • args: the arguments this field was called with; at the root level this will be equivalent to the args that the resolve(data, args, context, resolveInfo) {} method receives, at deeper levels this allows you to get the args for the nested fields without waiting for their resolvers to be called.
  • fieldsByTypeName: an object keyed by GraphQL object type names, where the values are another object keyed by the aliases of the fields requested with values of the same format as the root level (i.e. {alias, name, args, fieldsByTypeName}); see below for an example

Note that because GraphQL supports interfaces a resolver may return items of different types. For this reason, we key the fields by the GraphQL type name of the various fragments that were requested into the fieldsByTypeName field.

Once you know which specific type the result is going to be, you can then use this type (and its interfaces) to determine which sub-fields were requested - we provide a simplifyParsedResolveInfoFragmentWithType helper to aid you with this. In many cases you will know what type the result will be (because it can only be one type) so you will probably use this helper heavily.

Example usage:

const {
    parseResolveInfo,
    simplifyParsedResolveInfoFragmentWithType
} = require('graphql-parse-resolve-info');
// or import { parseResolveInfo, simplifyParsedResolveInfoFragmentWithType } from 'graphql-parse-resolve-info';

new GraphQLObjectType({
  name: ...
  fields: {
    ...
    foo: {
      type: new GraphQLNonNull(ComplexType),
      resolve(data, args, context, resolveInfo) {
        const parsedResolveInfoFragment = parseResolveInfo(resolveInfo);
        const { fields } = simplifyParsedResolveInfoFragmentWithType(
                    parsedResolveInfoFragment,
                    ComplexType
                );
        console.dir(fields);
        ...
      }
    }
  }
});

simplifyParsedResolveInfoFragmentWithType(parsedResolveInfoFragment, ReturnType)

Alias: simplify

Given an object of the form returned by parseResolveInfo(...) (which can be the root-level instance, or it could be one of the nested subfields) and a GraphQL type this method will return an object of the form above, with an additional field fields which only contains the fields compatible with the specified ReturnType.

Or, in other words, this simplifies the fieldsByTypeName to an object of only the fields compatible with ReturnType.

Example usage:

const {
    parseResolveInfo,
    simplifyParsedResolveInfoFragmentWithType
} = require('graphql-parse-resolve-info');

new GraphQLObjectType({
  name: ...
  fields: {
    ...
    foo: {
      type: new GraphQLNonNull(ComplexType),
      resolve(data, args, context, resolveInfo) {
        const parsedResolveInfoFragment = parseResolveInfo(resolveInfo);

        const { fields } = simplifyParsedResolveInfoFragmentWithType(
                    parsedResolveInfoFragment,
                    ComplexType
                );
        ...
      }
    }
  }
});

getAliasFromResolveInfo(resolveInfo)

Alias: getAlias

Returns the alias of the field being requested (or, if no alias was specified, then the name of the field).

Example:

const { getAliasFromResolveInfo } = require('graphql-parse-resolve-info');

new GraphQLObjectType({
  name: ...
  fields: {
    ...
    foo: {
      type: new GraphQLNonNull(GraphQLString),
      resolve(data, args, context, resolveInfo) {
        const alias = getAliasFromResolveInfo(resolveInfo);
        return alias;
      }
    }
  }
});

Example

For the following GraphQL query:

{
  allPosts {
    edges {
      cursor
      node {
        ...PostDetails
        author: personByAuthorId {
          firstPost {
            ...PostDetails
          }
          friends {
            nodes {
              ...PersonDetails
            }
            totalCount
            pageInfo {
              startCursor
            }
          }
        }
      }
    }
  }
}

fragment PersonDetails on Person {
  id
  name
  firstName
}

fragment PostDetails on Post {
  id
  headline
  headlineTrimmed
  author: personByAuthorId {
    ...PersonDetails
  }
}

The following resolver in the allPosts field:

const Query = new GraphQLObjectType({
  name: "Query",
  fields: {
    allPosts: {
      type: new GraphQLNonNull(PostsConnection),
      resolve(parent, args, context, resolveInfo) {
        const parsedResolveInfoFragment = parseResolveInfo(resolveInfo);
        const simplifiedFragment = simplifyParsedResolveInfoFragmentWithType(
          parsedResolveInfoFragment,
          resolveInfo.returnType
        );
        // ...
      },
    },

    // ...
  },
});

has parsedResolveInfoFragment:

{ alias: 'allPosts',
  name: 'allPosts',
  args: {},
  fieldsByTypeName:
   { PostsConnection:
      { edges:
         { alias: 'edges',
           name: 'edges',
           args: {},
           fieldsByTypeName:
            { PostsEdge:
               { cursor:
                  { alias: 'cursor',
                    name: 'cursor',
                    args: {},
                    fieldsByTypeName: {} },
                 node:
                  { alias: 'node',
                    name: 'node',
                    args: {},
                    fieldsByTypeName:
                     { Post:
                        { id: { alias: 'id', name: 'id', args: {}, fieldsByTypeName: {} },
                          headline:
                           { alias: 'headline',
                             name: 'headline',
                             args: {},
                             fieldsByTypeName: {} },
                          headlineTrimmed:
                           { alias: 'headlineTrimmed',
                             name: 'headlineTrimmed',
                             args: {},
                             fieldsByTypeName: {} },
                          author:
                           { alias: 'author',
                             name: 'personByAuthorId',
                             args: {},
                             fieldsByTypeName:
                              { Person:
                                 { id: { alias: 'id', name: 'id', args: {}, fieldsByTypeName: {} },
                                   name: { alias: 'name', name: 'name', args: {}, fieldsByTypeName: {} },
                                   firstName:
                                    { alias: 'firstName',
                                      name: 'firstName',
                                      args: {},
                                      fieldsByTypeName: {} },
                                   firstPost:
                                    { alias: 'firstPost',
                                      name: 'firstPost',
                                      args: {},
                                      fieldsByTypeName:
                                       { Post:
                                          { id: { alias: 'id', name: 'id', args: {}, fieldsByTypeName: {} },
                                            headline:
                                             { alias: 'headline',
                                               name: 'headline',
                                               args: {},
                                               fieldsByTypeName: {} },
                                            headlineTrimmed:
                                             { alias: 'headlineTrimmed',
                                               name: 'headlineTrimmed',
                                               args: {},
                                               fieldsByTypeName: {} },
                                            author:
                                             { alias: 'author',
                                               name: 'personByAuthorId',
                                               args: {},
                                               fieldsByTypeName:
                                                { Person:
                                                   { id: { alias: 'id', name: 'id', args: {}, fieldsByTypeName: {} },
                                                     name: { alias: 'name', name: 'name', args: {}, fieldsByTypeName: {} },
                                                     firstName:
                                                      { alias: 'firstName',
                                                        name: 'firstName',
                                                        args: {},
                                                        fieldsByTypeName: {} } } } } } } },
                                   friends:
                                    { alias: 'friends',
                                      name: 'friends',
                                      args: {},
                                      fieldsByTypeName:
                                       { PeopleConnection:
                                          { nodes:
                                             { alias: 'nodes',
                                               name: 'nodes',
                                               args: {},
                                               fieldsByTypeName:
                                                { Person:
                                                   { id: { alias: 'id', name: 'id', args: {}, fieldsByTypeName: {} },
                                                     name: { alias: 'name', name: 'name', args: {}, fieldsByTypeName: {} },
                                                     firstName:
                                                      { alias: 'firstName',
                                                        name: 'firstName',
                                                        args: {},
                                                        fieldsByTypeName: {} } } } },
                                            totalCount:
                                             { alias: 'totalCount',
                                               name: 'totalCount',
                                               args: {},
                                               fieldsByTypeName: {} },
                                            pageInfo:
                                             { alias: 'pageInfo',
                                               name: 'pageInfo',
                                               args: {},
                                               fieldsByTypeName:
                                                { PageInfo:
                                                   { startCursor:
                                                      { alias: 'startCursor',
                                                        name: 'startCursor',
                                                        args: {},
                                                        fieldsByTypeName: {} } } } } } } } } } } } } } } } } } },

and the simplified simplifiedFragment is the same as parsedResolveInfoFragment, but with the additional root-level property fields which compresses the root-level property fieldsByTypeName to a single-level object containing only the fields compatible with resolveInfo.returnType (in this case: only edges):

{ alias: 'allPosts',
  name: 'allPosts',
  args: {},
  fieldsByTypeName:
        ...as before...
  fields:
   { edges:
      { alias: 'edges',
        name: 'edges',
        args: {},
        fieldsByTypeName:
           ...as before...

Thanks

This project was originally based on https://github.com/tjmehta/graphql-parse-fields, but has evolved a lot since then.

changelog (log de mudanças)

SEE POSTGRAPHILE RELEASES INSTEAD

We use PostGraphile's GitHub releases tab to log our changes in detail, but this auto-generated changelog helps us to produce that list, and it may be helpful to you also.

(2023-01-12)

Bug Fixes

4.12.3 (2022-05-25)

Bug Fixes

  • pg-sql2: remove another spread (#796) (dadd261)
  • pg-sql2: use loop not spread, fixes call stack size exceeded (#793) (b4d6c38)
  • pubsub: listen for PG client error to prevent crashes (#791) (e0b107a)

4.12.2 (2021-10-21)

Features

  • inflection: use builtin for NATURAL and PRIMARY_KEY_ASC/DESC (#759) (f2862a1)
  • tags: allow smart tags to indicate a column has a default (#760) (8538ed0)

4.12.1 (2021-05-27)

Features

  • utils: support for NULLS FIRST/LAST in orderByAscDesc (#737) (99b1a8e)

4.12.0 (2021-05-26)

Bug Fixes

  • order: fix order by computed column SQL item bug (#741) (0635ecb)
  • uniqueKey/pgViewUniqueKey applies to views (#739) (b715f6d)

Features

4.12.0-alpha.0 (2021-02-15)

Features

  • pg: connections can use named queries (#715) (352dab3)
  • pg: makeProcField can be used to construct aggregates (#714) (8e0102b)
  • pg: procFieldDetails helper (#717) (59a07a2)

4.11.2 (2021-01-29)

Bug Fixes

  • watch: fix pool leak on unexpected connection termination (#711) (b2fbc21)

4.11.1 (2021-01-22)

Bug Fixes

  • compat: make utils compatible with older engine (#707) (bd3161d)

4.11.0 (2021-01-20)

Bug Fixes

  • graphql: ensure buildSchema fails on invalid GraphQL schema (#695) (c837e09)
  • pg-sql2: use same placeholder for same sql.value node (#705) (969d923)

Features

4.10.0 (2020-11-18)

Features

  • deps: support for GraphQL v15 (#689) (3e7f98f)
  • pg: support domain constrained composite types (#615) (215f5cf)
  • pubsub: add maxListeners to subscription eventEmitter (#688) (576177f)

4.9.2 (2020-10-23)

Bug Fixes

4.9.1 (2020-10-16)

Bug Fixes

  • domains over array types now correctly apply "tweaks" (#672) (99259f4)
  • graphile-build-pg: add more numeric casting exceptions (#661) (ea8480e)
  • load makeAddPgTableConditionPlugins before PgConnectionArgOrderBy (#658) (16d7b30)
  • proc: fix output of record/table returning functions (#667) (7182d92)
  • types: fix parsing interval to support fractional seconds (#678) (79017c5)
  • utils: selectGraphQLResultFromTable now debugs SQL (#668) (04a996a)

Features

4.9.0 (2020-09-09)

Bug Fixes

  • graphql: root level custom query connection fields now nullable (#653) (131c6ac)
  • improve error when cannot read from enum table (#651) (dbafe55)
  • intervals now return zeros instead of nulls (also updated dependencies) (#656) (2739f79)

Features

  • add UUID validation so errors are raised earlier (#652) (9265262)

4.8.0 (2020-08-11)

Bug Fixes

  • sql: fix POSTGRAPHILE_PREPARED_STATEMENT_CACHE_SIZE envvar (#639) (5e79bd0)

Features

4.8.0-rc.0 (2020-08-04)

Bug Fixes

  • error message typo (001de88)
  • live: live collection for single backward relation record (#625) (7f0225e)
  • watch: handle errors during watchSchema (#624) (4ef1b7b)

Features

  • add support for "enum tables" (#635) (e6bde66)
  • add support for geometric types (#637) (419ec87)
  • graphile-utils: Type update on addPgTableOrderByPlugin (#629) (91dbf6f)
  • subscriptions: @pgSubscription now supports initial events (#612) (e862aad)
  • warn early if placeholders will be exhausted (#632) (5c22e41)

4.7.0 (2020-04-27)

Bug Fixes

  • introspection: don't query roles when ignoring RBAC (#598) (bfe2427)
  • types: relax index signature in JSONPgSmartTags (#618) (edf2abf)

Features

  • graphile-build-pg: expose more utils (#601) (ac74e2d)

4.6.0 (2020-01-27)

Features

4.5.6 (2019-12-13)

Bug Fixes

  • utils: fix smart tags regression on unqualified tables (#587) (f56511f)

4.5.5 (2019-12-11)

Bug Fixes

  • utils: fix smart tags for attributes (324f066)

4.5.4 (2019-12-11)

Bug Fixes

  • utils: to match early enough, we need build to be passed (9aa5565)

4.5.3 (2019-12-11)

Bug Fixes

Features

  • utils: makeExtendSchemaPlugin accepts typeDef array (#574) (82ff872)

4.5.2 (2019-11-22)

Bug Fixes

  • utils: make makeAddPgTableConditionPlugin work on simple co… (#569) (0a4db65)

4.5.1 (2019-11-20)

Features

  • tags: improve JSON format for Smart Tags (#568) (cb8eac1)

4.5.0 (2019-11-20)

4.5.0-rc.0 (2019-11-12)

4.4.6-alpha.0 (2019-11-08)

Bug Fixes

  • jwt: allow JWT exp to be bigint (#542) (69c7e8e)
  • omit: if you omit update on all columns don't throw (#531) (b5d9e99)
  • pagination: fix bug in cursor pagination for PL/pgSQL SETOF… (#559) (0089a07)
  • types: correct tuples to arrays in pgIntrospectionPlugin (#530) (6488d5c)
  • types: export more types inc PgIntrospectionResultByKind (#532) (1689f66)
  • types: minor TypeScript fixes (#545) (0170064)
  • types: use jwt.Secret type in PostGraphileCoreOptions (#546) (be18000)
  • watch: don't built schema twice in watch mode (#558) (0a36f7b)

Features

  • connections: expose totalCount on custom connections (#529) (b6c08cf)
  • pg: add partial index detection to introspection (#535) (360e5e0)
  • pg: add support for cidr and macaddr types (#520) (676c3f2)
  • QueryBuilder: new methods for managing QB children (#537) (1a8a0bc)
  • utils: @pgQuery support for scalars (#534) (49259c2)
  • utils: [@pg](https://github.com/pg)Query.source can be function (#555) (907c8e6)
  • utils: add makePgSmartTagsPlugin (#541) (40a7bfa)
  • utils: makeExtendSchemaPlugin supports enums and default values (#562) (2a23aee)

4.4.5 (2019-09-23)

Bug Fixes

  • introspection: corrected bitmasks for mutability checks (#508) (5fae076)
  • remove sortable/filterable from functions with required args (#519) (2335d6e)

Features

  • allow passing readCache as an object (#479) (1a9dc17)
  • query: improve unique orderBy error message (#515) (29d87da)
  • utils: add PG plugin generators for conditions/orderBy (#517) (96c1ed4)

4.4.4 (2019-08-09)

Bug Fixes

  • makeExtendSchemaPlugin: no longer omits built-in directives (#500) (18b4ff5)

4.4.3 (2019-08-07)

Bug Fixes

  • cursors: better cursor validation (#499) (834687d)
  • debug: correct field.name to scope.fieldName (#489) (122a612)
  • ignoreIndexes: mark fake constraints as indexed (#496) (b3b4a60)
  • inflectors: names that begin with a digit are prefixed with underscore (#495) (8eebaeb)
  • nodeId: fix object IDs for arbitrary precision numbers and ints > 9 quadrillion (#493) (254c80a)
  • nodeIds: warn if two types try and register the same alias (#498) (4fa78b1)
  • pubsub: use perpetual exponential back-off (#497) (001d45e)
  • schema: set mutation payload edge orderBy arg default to a list (#494) (18b132e)

Features

  • ignoreIndexes: add option hideIndexWarnings (#462) (3cfb204)
  • jwt: add support for jsonwebtoken.sign options (#466) (7825f25)

4.4.2 (2019-06-29)

Features

  • utils: make makeExtendSchemaPlugin more powerful (#480) (e73506b)

4.4.1 (2019-06-21)

Bug Fixes

  • deps: Add iterall to graphile-build dependencies (#473) (3f2040b)
  • lds: correct the set of LDS announcement types handled (#468) (dde59fa)
  • proc: remove invalid fields from mutation functions returning setof (#478) (6d3060d)
  • watch: fix typo in warning message CLI flag (#475) (fca1105)

4.4.1-alpha.2 (2019-05-10)

Features

  • perf: a few performance enhancements (#459) (d57c180)

4.4.1-alpha.1 (2019-05-07)

Performance Improvements

  • a number of performance optimisations (#458) (5bca05b)

4.4.1-alpha.0 (2019-05-05)

4.4.0 (2019-05-03)

4.4.0-rc.1 (2019-04-29)

Features

  • subscriptions-lds: enable using envvars with lds as library (#456) (2353cf9)

4.4.0-rc.0 (2019-04-23)

Bug Fixes

  • description: fix typo in big-int definition (#453) (0f2442b)

Features

4.4.0-beta.13 (2019-04-18)

Bug Fixes

  • live: fix live for relations with multiple keys (#451) (22d7024)

4.4.0-beta.12 (2019-04-17)

Bug Fixes

  • error: add TYPE for introspection error messages (#449) (019996f)
  • sql: handle non-null compound columns with all-null values (#446) (fe2e5dc)
  • tx: split transaction commit to separate query for safety (#448) (31913eb)

Features

4.4.0-beta.11 (2019-04-15)

Bug Fixes

4.4.0-beta.10 (2019-04-14)

Bug Fixes

  • docs: fix description of Subscription type (#440) (2db5472)
  • graphql: --no-setof-functions-contain-nulls now applies to simple collections too (#441) (a3f118d)
  • pg: handle more errors on Postgres restart (#439) (cb59155)
  • ts: replace 'export *' with explicit exports to allow declaration merging (#437) (9b47cf8)
  • watch: rewrite schema watching; handle Postgres restart (#438) (98f796c)

Features

  • plugins: enable plugins to prevent using asterisk (#436) (49b9da4)

4.4.0-beta.9 (2019-04-04)

Bug Fixes

  • live: solve race conditions in live queries (#433) (e497590)
  • types: add missing useAsterisk on QueryBuilder (cda3d89), closes #432

4.4.0-beta.8 (2019-03-25)

Bug Fixes

  • connection: don't query identifiers unless necessary (#429) (16785c4), closes #428

4.4.0-beta.7 (2019-03-22)

Bug Fixes

  • types: add PoolClient to pgConfig union type (#425) (413ea16)

Features

  • types: make more builtin PG types hookable (#426) (a5abf2d)

4.4.0-beta.6 (2019-03-18)

Bug Fixes

4.4.0-beta.5 (2019-03-15)

Bug Fixes

  • live: remove format-version for RDS compatibility (#422) (4fcd476)

Performance Improvements

  • connections: more efficient totalCount (#421) (00c8616)

4.4.0-beta.4 (2019-03-12)

Bug Fixes

  • hasVersion: allow pre-releases to satisfy version check (#419) (b12bd78)

Features

  • introspection: include namespaceName for extensions (#417) (69ddb85)

4.4.0-beta.3 (2019-03-08)

Features

4.4.0-beta.2 (2019-03-07)

Features

  • aggregates: add support for aggregates (#415) (8975cba)
  • perf: use more optimal query when no column-level select grants (#414) (2b28679)
  • utils: support connections in makeExtendSchemaPlugin (#413) (7f5fffb)

4.4.0-beta.1 (2019-02-28)

Features

  • watch: use ownerConnectionString for installing watch fixtures (1550921)

4.4.0-beta.0 (2019-02-28)

Bug Fixes

  • args: allow makeWrapResolversPlugin to override args (#410) (9a70bfa), closes #396
  • arrays: fix arrays of intervals, etc (#405) (cc3a6b1)
  • domains: input field nullable if domain has default (#401) (dd2ca61)
  • live: add scope to new fields (b47f334)
  • nulls: fix null detection when requesting only nullable columns (#406) (c573a15)
  • nulls: totalCount shouldn't be nullable (#411) (023fa90)
  • procs: fix relation errors in custom mutations when returning null (#407) (3a9887d)

Features

  • smart-comments: simpleCollections smart comment (#409) (3248a2e)

4.4.0-alpha.0 (2019-02-21)

Bug Fixes

  • hstore: include explicit namespace when casting (#395) (1978ffa)

Features

  • subscriptions: introducing live query support (#399) (86ef40f)
  • subscriptions: pg-pubsub module (#400) (7506da1)

4.3.1 (2019-01-24)

Bug Fixes

  • regression: restore old orderBy call signature (#386) (e7fe7cf), closes #383
  • restore but severely deprecate ancient inflectors (#381) (c7a7a5c)
  • typo: pgInflection -> pgIntrospection (#382) (12c42c1)
  • windows: add support for Windows CRLF in smart comments (#385) (d8552cd)

Features

4.3.0 (2019-01-17)

Bug Fixes

  • compatibility: don't fail at introspection when intarray extension is installed (#374) (f90a61b)
  • docs: update introspection query URL (#380) (132fe26)
  • jwt: handle bigint / numeric in JWTs (#376) (c0af902)
  • sql: tsrange, tstzrange, int8range and numrange now properly formatted (#371) (6218c6a)

Features

4.2.1 (2019-01-04)

Features

  • utils: enable wrapping resolvers matching a filter (#369) (065d5d4)

4.2.0 (2018-12-19)

Features

  • constraints through smart comments (view foreign keys, etc) (#365) (7c712a9)
  • indexes: always warn on FK skip due to no index (#366) (79df91d)

4.1.0 (2018-12-06)

4.1.0-rc.4 (2018-12-03)

Bug Fixes

4.1.0-rc.3 (2018-12-02)

Bug Fixes

  • cursors: fix bad cursor error (#362) (188769e)
  • nulls: make nodes nullable, consistent with node (#357) (7d49f8e)
  • perf: detect unique columns and don't add primary key to order in that case (#361) (a7eb61f)
  • types: fix SchemaBuilder TypeScript types (#358) (f01be28)

Features

4.1.0-rc.2 (2018-11-23)

Bug Fixes

4.1.0-rc.1 (2018-11-23)

Bug Fixes

  • avoid deprecationReason: undefined (#346) (ba9ad33)
  • sql: use JSONB concatenation when necessary (#333) (6195793)
  • typescript: ignore fieldASTs warning (#348) (9f44847)

Features

  • add [@deprecated](https://github.com/deprecated) support to functions (#340) (a25b19f)
  • add build.versions and build.hasVersion function (#339) (4a05670), closes #338
  • indexes: introspect index column properties (asc, nulls first) (#335) (6925d6d)
  • pg: support ordering with NULLS FIRST / NULLS LAST (#332) (545d082)
  • utils: makeProcessSchemaPlugin (#354) (da8b39d)
  • utils: makeWrapResolversPlugin, makeChangeNullabilityPlugin (#352) (9393990)

4.1.0-rc.0 (2018-10-31)

Features

  • watch: option to skip installing watch fixtures (#328) (e085cbd)

4.1.0-alpha.1 (2018-10-25)

Bug Fixes

  • deps: add chalk as explicit dependency of graphile-build (#322) (84e4b91)

Features

  • pgIgnoreIndex = false feature; fix introspection bug (#324) (8a4e478)
  • pgLegacyFunctionsOnly option (#325) (4c1cfb9)
  • functions: support IN / OUT / INOUT arguments and RETURNS TABLE (#296) (a029c45)

4.1.0-alpha.0 (2018-10-15)

Bug Fixes

  • remove ignore from lerna config (78ad1c5)
  • remove recurseDataGeneratorsForField from many places (#316) (1f3328e)

Features

  • debug: enhance SQL debugging (#317) (128b0d5)
  • detect invalid skipPlugins option (#320) (48f2acf)
  • inflector: better errors, overriding possible with makeAddInflectorsPlugin (#315) (f437721)
  • make skipping NodePlugin easier (#319) (532fd40), closes #310

Performance Improvements

4.0.1 (2018-10-08)

Bug Fixes

  • sql: queryFromResolveData call withBuilder before resolveData.pgQuery (#307) (8201251)

4.0.0 (2018-10-02)

4.0.0-rc.12 (2018-09-22)

Bug Fixes

  • errors: Add missing swallowError call, plus debugging URL (#300) (bc66c8f)
  • errors: Improve error message for invalid pg configurations (#301) (8f3c0e7)

Features

  • introspection: introspect function cost (#304) (6b0cb9e)

4.0.0-rc.11 (2018-09-13)

Bug Fixes

Features

  • pg: PG10 identity columns and preliminary PG11 support (#294) (1e040ba), closes #244
  • pg: Recognise unique multi-key relations as unique (#298) (2727623)

4.0.0-rc.10 (2018-09-04)

Features

  • debugging: massively improve name collision errors (#292) (a6b4dd9)

4.0.0-rc.9 (2018-08-24)

Bug Fixes

  • types: appease TypeScript (hopefully) (#290) (951b551)

4.0.0-rc.8 (2018-08-24)

Features

4.0.0-rc.7 (2018-08-22)

Features

  • types: export more types from postgraphile-core (#288) (98212f3)

4.0.0-rc.6 (2018-08-22)

Bug Fixes

  • error: template string accidentally in quotes (#281) (a9279a0)
  • graphql: handle all long aliases (#272) (92d82da), closes #268
  • ignore-extensions: add pg_depend.classid clause to introspection (#285) (8e68052)
  • mutations: add update and delete mutations for tables lacking primary key (#278) (b28328f)
  • plugins: detect null plugins (#274) (c4f848d), closes #257
  • utils: error when using legacy graphql (#287) (9329fe3), closes #283

Features

  • hstore: add support for the hstore type (#273) (e269c31)
  • makeExtendSchemaPlugin: add support for enum (#269) (0fce134)
  • postgres: add support for postgres inet type (#279) (319d096)
  • query-builder: reference parent query builder on child (#270) (af9ebd9)
  • smart-comments: can edit description of relation fields (#275) (a9efc5c), closes #204
  • smart-comments: can override pgViewUniqueKey for a view (#276) (b5f48c7), closes #178
  • types: beginnings of TypeScriptification (#280) (9fe9b3e)
  • utils: add [@requires](https://github.com/requires)(columns: [...]) directive (#286) (75cd16b)

4.0.0-rc.5 (2018-07-25)

Bug Fixes

  • errors: More explicit error on schema build fail (#264) (d49c36a)
  • money: have DB convert money to numeric for us (#258) (be71fd4)
  • rbac: allow exposing hidden types when sensible (#265) (aeccb4c)

Features

  • build: add getTypeAndIdentifiersFromNodeId(nodeId) (#262) (447239d)

4.0.0-rc.4 (2018-07-14)

Bug Fixes

Features

  • utils: can define subscribe along with resolve (#246) (22aaa29)

4.0.0-rc.3 (2018-06-30)

Bug Fixes

  • rbac: add support for type modifiers to gql2pg (#243) (f71ffd7), closes #234
  • rbac: don't exclude tables that use column-based select permissions (#242) (70dac62)

4.0.0-rc.2 (2018-06-25)

Features

  • pg: introspection of subtypes, exclude extension resources (#233) (76b348c)
  • pg: RBAC-based auto-omitting; functions support patch table type (#240) (8c2b716)

4.0.0-rc.1 (2018-06-09)

Bug Fixes

4.0.0-beta.8 (2018-05-31)

Bug Fixes

Features

  • collections: add "simple collections" (#222) (548e5ef)

4.0.0-beta.7 (2018-05-15)

Bug Fixes

  • procs: fix querying only totalCount on procedure connections (#221) (76feb72)

4.0.0-beta.6 (2018-05-09)

Bug Fixes

  • procs: complex function fixes (setof, complex types, etc) + tests (#219) (d3937ad)
  • procs: fix mutations that return null throwing errors (#220) (6899c45)

4.0.0-beta.5 (2018-05-05)

Bug Fixes

  • procs: handle returning arrays of custom types (#218) (7b04cff)

4.0.0-beta.4 (2018-05-04)

4.0.0-beta.3 (2018-05-04)

Bug Fixes

  • directives: Omit skipped fields from execution plan (#201) (a5a95d3)
  • dynamic-json: variables in dynamic JSON subfields now supported (#210) (6f86dc8)
  • introspection: gracefully handle stale pg_catalog.pg_description (#212) (4e92f98)

Features

  • inflection: Pluggable inflector, smart-comment overridable (#199) (399ea02)
  • plugins: Add backward/forward boolean relation identifiers (#215) (cb88313)
  • plugins: Add pgFieldIntrospection to GraphQLInputObjectType:fields:field scope (#202) (22859bd)
  • subscriptions: Subscriptions base plugin (4c1f6e8)

4.0.0-beta.2 (2018-03-14)

Bug Fixes

  • sql: remove unnecessary row expansion (#196) (3ebc627)

4.0.0-beta.1 (2018-03-10)

Bug Fixes

  • sql: still introspect when standard_conforming_strings is off (#193) (4d1500b)

4.0.0-beta.0 (2018-03-07)

4.0.0-alpha.5 (2018-03-02)

4.0.0-alpha.4 (2018-02-28)

Performance Improvements

4.0.0-alpha.3 (2018-02-27)

Bug Fixes

Features

  • compat: enable lower case Json/Uuid like v3 (#184) (20a084f)

4.0.0-alpha.2 (2018-02-27)

Bug Fixes

  • compatibility: v3 compatibility tweaks (#181) (5091cc6)

4.0.0-alpha.1 (2018-02-23)

4.0.0-alpha (2018-02-23)

Bug Fixes

  • deps: Fix dependency patterns, graphql compatibility (#172) (0c4f9a5)

Features

0.1.0-alpha.41 (2018-02-19)

0.1.0-alpha.40 (2018-02-19)

0.1.0-alpha.39 (2018-02-17)

Bug Fixes

  • clash: Auto-rename clashing _input/_patch tables (#159) (f5b5506)
  • mutations: add tests for orderBy multiple on mutation payload edge + fix (#162) (4cf146c)
  • mutations: Fix null cursor on mutations, make orderBy an array too (#160) (014daaf)
  • precision: Fix bigint/bigfloat precision loss (#158) (5dbf6e4)
  • schema: remove incorrect 'pagination' comments (#166) (72f36e6)
  • sql: reduce redundancy in select statements (#161) (29fb723)

Features

  • errors: Better clash error messages (#164) (faf3b8d)
  • errors: Warn when one or more of the schemas you've specified are missing (#165) (f422783)
  • pg: duck-type PG to prevent 'provide valid PG client' error (#168) (d5ed9a9)
  • support enums with asterisks in (#163) (cbbf3ea)

0.1.0-alpha.38 (2018-01-14)

Features

  • cache: enable memoizing time-intensive tasks to disk (#149) (f5224fe)

0.1.0-alpha.37 (2017-12-16)

Bug Fixes

  • composite-types: Fix null composite column issue (#140) (57a3fb9)
  • custom-mutations: Allow mutation procedures to accept table args (#133) (1fe3b4e)
  • delete: always populate deleted nodeId (#143) (5f4539b)
  • getTypeByName: register default types like JSON earlier (#135) (a383a35)
  • sql: don't return null for empty arrays (#129) (fbbf4d6)
  • tags: Stringify array of deprecated tags (#130) (83abbb8)
  • types: use named BigFloat type over GraphQLString (#141) (649f6bb)

Features

  • connections: Change orderBy argument to GraphQLList (#144) (767cfc7)
  • deprecation: Deprecate fields from column comments (#128) (67acc7c)
  • postgraphile-core: Add removePlugins option (#139) (1652ee8)
  • types: add support for 'point' type (#145) (18ee16e)

0.1.0-alpha.36 (2017-12-03)

Bug Fixes

  • dependencies: Solve missing dependency (#122) (cda42a5), closes #119
  • fields: make fieldWithHooks much more consistent (#124) (eb1a6bc)
  • procs: Functions no longer passed null for missing arguments (unless necessary) (#125) (2d9fbb9)
  • types: Prevent numeric overflow for arbitrary-precision types (#123) (d2c1e95)

0.1.0-alpha.35 (2017-11-02)

Bug Fixes

  • arrays: Fix many issues related to arrays of compound types (#109) (df42344)
  • graphql: correctly detect non nullable domain (#113) (cab2d3b), closes #111

0.1.0-alpha.34 (2017-10-29)

0.1.0-alpha.33 (2017-10-29)

Bug Fixes

  • columns: don't let columns overwrite each-other (#106) (66f2cce)
  • cursors: only use cursor when order is unique (#107) (45e916f)
  • graphql: solve some of the array of custom type issues (#92) (2a7ee5e)
  • json: fix JSON handling in viaTemporaryTable (#90) (663cedc)
  • procedures: fix arg refs where SQL and GraphQL field names differ (#91) (ea5a44f)

Features

  • conditions: enable filtering for a column being null (#96) (db30a95)
  • cursors: improve cursors on non-unique orderings; add pgViewUniqueKey (#101) (e032764)
  • inflector: add foreign table to manyRelationByKeys call (#80) (d2da240), closes #77
  • pgColumnFilter: introduce experimental column filter callback (#73) (0fe8cfb), closes #65
  • QueryBuilder: pass self to callIfNecessary callbacks (#94) (e169d33), closes #88

0.1.0-alpha.32 (2017-09-22)

Bug Fixes

  • mutations: nullable payloads, rollback individual mutations on error (#59) (4d00257)
  • mutations: setting null on create for nullable column with non-null default (#74) (c609826)
  • types: handle empty enum values; improve type error message (#78) (99d917c)

Features

  • inflector: split rowByUniqueKeys from singleRelationByKeys (#72) (46e88dd)
  • plugins: add type to context (#79) (a161f53)

0.1.0-alpha.31 (2017-09-14)

Bug Fixes

  • namespaces: allow JWT from private schema; pass non-null schema name to inflectors (#70) (0d48a5d)

0.1.0-alpha.30 (2017-09-12)

Bug Fixes

  • graphql: fix UUID type with pgExtendedTypes (#67) (02e8868)

0.1.0-alpha.29 (2017-09-11)

Features

  • inflection: export inflection engine (#64) (dc032ca)

0.1.0-alpha.28 (2017-09-05)

Bug Fixes

  • procedures: support procedures returning setof composite (#61) (b641093), closes #60 #60

0.1.0-alpha.27 (2017-08-23)

Bug Fixes

  • errors: tweaks to errors/logs/etc (#56) (74654d5)

Features

  • export case utils (#58) (8531671)
  • graphile-build-pg: export case-altering functions (#54) (fd5fe1c)

0.1.0-alpha.26 (2017-08-21)

Bug Fixes

  • procedures: fix paginating backwards through procedures returning setof (#53) (731d223)

0.1.0-alpha.25 (2017-08-20)

Bug Fixes

  • relations: make forward relations nullable (#52) (97dd5df)

0.1.0-alpha.24 (2017-08-16)

Bug Fixes

  • viaTempTable: safer (does not assume array type existence) (ad36f6d)

0.1.0-alpha.23 (2017-08-15)

Bug Fixes

  • condition: fix scope typo (b5740a2)
  • security: double-ensure safety of column aliases (#48) (8a9b23b)

0.1.0-alpha.22 (2017-08-14)

Bug Fixes

  • strict-fns: fix omitted arg for computed column, non-null args (#47) (550802d)

0.1.0-alpha.21 (2017-08-10)

Bug Fixes

  • schema: don't add node ID if no PK (8e261bb)

0.1.0-alpha.20 (2017-08-09)

Bug Fixes

0.1.0-alpha.19 (2017-08-09)

Bug Fixes

  • inflection: solve two enum issues (#42) (2fd2bbb)

0.1.0-alpha.18 (2017-08-08)

Features

  • pagination: allow using cursors with orderBy=NATURAL (#39) (2c3156b)

Performance Improvements

  • totalCount: only query __cursor/rows when needed (#40) (f7454f1)

0.1.0-alpha.17 (2017-08-04)

Features

  • graphile-build-pg: export all plugins (#35) (9bc9d2e)

0.1.0-alpha.16 (2017-08-01)

Bug Fixes

  • mutations: remove temp tables due to privilege requirements (#31) (1a74750)

0.1.0-alpha.15 (2017-08-01)

Bug Fixes

  • mutations: computed columns after mutations now access non-stale data (#28) (5069fc6)

0.1.0-alpha.13 (2017-07-29)

0.1.0-alpha.1 (2017-07-29)

Reverts

0.0.1-alpha11.2 (2017-07-28)

Bug Fixes

  • node: change nodeIdFieldName to 'id' (#26) (1df0743)

0.0.1-alpha11.1 (2017-07-26)

Features

  • debug: output warnings on stderr; hint how to view full error (#24) (77edca3)
  • hooks: hook for individual enum value (#25) (3d82458)

0.0.1-alpha11.0 (2017-07-26)

Bug Fixes

  • extensions: skip things we don't understand (#22) (7fb5d8f)
  • types: Convert single-row fetches to_json for consistency (#21) (a98f2f6)

0.0.1-alpha10.0 (2017-07-25)

Features

  • graphql-parse-resolve-info: add Flow types (#12) (34322d1)

0.0.1-alpha9.3 (2017-07-16)

0.0.1-alpha9.2 (2017-07-15)

0.0.1-alpha9.1 (2017-07-15)

0.0.1-alpha9.0 (2017-07-15)

0.0.1-alpha8.3 (2017-07-14)

0.0.1-alpha8.2 (2017-07-14)

0.0.1-alpha8.1 (2017-07-13)

0.0.1-alpha8.0 (2017-07-13)

0.0.1-alpha7.1 (2017-07-13)

0.0.1-alpha7.0 (2017-07-13)

0.0.1-alpha6.8 (2017-07-13)

0.0.1-alpha6.7 (2017-07-13)

0.0.1-alpha6.6 (2017-07-13)

0.0.1-alpha6.5 (2017-07-13)

0.0.1-alpha6.4 (2017-07-13)

0.0.1-alpha6.3 (2017-07-13)

0.0.1-alpha6.2 (2017-07-13)

0.0.1-alpha6.1 (2017-07-13)

0.0.1-alpha6.0 (2017-07-12)

0.0.1-alpha5.1 (2017-07-12)

0.0.1-alpha5.0 (2017-07-12)

0.0.1-alpha4.1 (2017-07-12)

0.0.1-alpha4.0 (2017-07-12)

0.0.1-alpha3.7 (2017-07-08)

0.0.1-alpha3.6 (2017-07-07)

0.0.1-alpha3.5 (2017-07-07)

0.0.1-alpha3.4 (2017-07-07)

0.0.1-alpha3.3 (2017-07-07)

0.0.1-alpha3.2 (2017-07-07)

0.0.1-alpha3.1 (2017-07-07)

0.0.1-alpha3.0 (2017-07-06)

0.0.1-alpha2.4 (2017-07-05)

0.0.1-alpha2.3 (2017-07-05)

0.0.1-alpha2.2 (2017-07-05)

0.0.1-alpha2.1 (2017-07-05)

0.0.1-alpha2.0 (2017-07-05)

0.0.1-alpha1.0 (2017-07-05)

Features

  • Add parsing of resolveInfo (6ae734f)
  • Introduce buildFieldWithHooks (76cb2af)
  • Introduce buildObjectWithHooks (94b9d6f)
  • Introduce SchemaBuilder (2b6d5f3)
  • recursive field generators (37d73c1)
  • resolveInfo: can now process arguments (c94eeb2)
  • start enabling field data (62ac647)
  • Unique object for each build (94a10d5)