Skip to content

Releases: piglovesyou/graphql-let

v0.15.1

19 Aug 10:24
Compare
Choose a tag to compare

Environment variable interpolation

.graphql-let.yml can contain environment variables. Please read the docs of string-env-interpolation for more details.

schema:
  - ${GRAPHQL_ENDPOINT}:
      headers:
        Authorization: Bearer ${ACCESS_TOKEN}
  - lib/type-defs.graphqls

v0.15.0

08 Aug 16:02
Compare
Choose a tag to compare

GraphQL fragments through # import syntax🚀🚀🚀

The more your project gets bigger, the more you get chances to have duplicated GraphQL documents. # import is useful when you share common definitions as GraphQL fragments.

Define your fragment named as partial.graphql

fragment Partial on User {
    id
    name
}

then import it and apply.

# import Partial from './partial.graphql'

query Viewer {
    viewer {
        ...Partial
    }
}

Glob and multiple schema pointers as schema: **/*.graphqls💫

Now specifying multiple pointers in schema is available.

schema:
    - "src/**/*.graphqls"
    - "lib/**/*.graphqls"

Breaking change: You need schemaEntrypoint if you use Resolver Types

Since you can specify multiple schema files in the schema field. Please specify

schemaEntrypoint: lib/schema.graphqls

Then graphql-let generates lib/schema.graphqls.d.ts as Resolver Types.

Breaking change: You need to specify withHooks: true option if you use @graphql-codegen/react-apollo@2 and React Hooks functions

You'll need withHooks: true option in .graphql-let.yml config, if:

  • you upgrade graphql-let from <15 to >=15
  • you use @graphql-codegen/react-apollo@2

The background of this is mainly because of my decision failure.

  • @graphql-codegen/react-apollo@2's default setting is withHOC: true; withHooks: false
  • @graphql-codegen/react-apollo@3 is withHOC: false; withHooks: true
  • In graphql-let < 15, I passed hard code options of withHOC: false; withHooks: true, since I wanted it😣
  • From graphql-let >= 15, I erased the hard code options in order to passes most of the user config options through to GraphQL code generator API ←Breaking change

Users cloned source from vercel/next.js/examples/with-typescript-graphql recently should fall into this category.

v0.14.0

04 Aug 08:18
Compare
Choose a tag to compare

Inline GraphQL document support by Babel Plugin⚡️⚡️⚡️

Please refer to the document to know how to set up.

v0.13.0

02 Aug 04:59
Compare
Choose a tag to compare

Jest Transformer is now available by #126 @irrelevelephant 🎉

Please refer to the document to know how to use it.

v0.12.1

02 Aug 04:44
Compare
Choose a tag to compare

A bug fix: #118 (comment), thanks to the perfect test case by @marklawlor

Before: TS API will write the number of .d.tss more than .ts(x)s when a .ts(x) imports modules of project files and it succeeds to resolve the file. Here I described when it happens.

After: We should filter .d.ts only for .ts(x)s that we put as entry points. Now it does so the number of generated .d.ts must always be identical to the input .ts(x)s.

I refactored the code additionally.

v0.12.0

15 Jul 08:35
Compare
Choose a tag to compare

Accept object in schema in .graphql-let.yml by 2a6cecc @salzhrani 🎉

Now you can specify an authorization token to GraphQL endpoint, for example.

schema:
  https://api.github.com/graphql:
    headers:
      authorization: bearer YOUR_TOKEN

Other improvements

  • Fix bug: respect and keep valid caches 19e3fe9
    • as-is: Generate caches first run and use it second, but remove them so it has to regenerate in the third run
    • to-be: Always respect and keep valid caches

v0.11.3

15 Jul 08:26
Compare
Choose a tag to compare

v0.11.2

15 Jul 08:22
Compare
Choose a tag to compare
  • Fix #118; Next.js launch error

v0.11.1

09 Jul 14:13
Compare
Choose a tag to compare
  • graphql-tag commands now removes old caches so the size of the cache directory does not keep growing anymore.
  • cacheDir option can specify the cache directory for those who want to have full control of the output files.

v0.11.0

09 Jul 10:36
Compare
Choose a tag to compare

Now graphql-let uses tsconfig.json in your root directory, thanks to #116 by @salzhrani ! If you want to use a specific config for graphql-let, TSConfigFile option in .graphql-let.yml will overwrite the config path.

Be careful: It's possible to break if you tsconfig.json doesn't fit graphql-let's TypeScript compilation. Please have your own if there's trouble.