Skip to content

Update dependency graphql-code-generator to v0.15.0#46

Open
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/graphqlcodegenerator-monorepo
Open

Update dependency graphql-code-generator to v0.15.0#46
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/graphqlcodegenerator-monorepo

Conversation

@renovate
Copy link

@renovate renovate bot commented Oct 31, 2018

This PR contains the following updates:

Package Type Update Change References
graphql-code-generator devDependencies minor 0.12.6 -> 0.15.0 source

Release Notes

dotansimha/graphql-codegen

v0.15.0

Compare Source

Core

TypeScript Template

TypeScript Resolvers

Add

TypeScript MongoDB

🎉 🎉 🎉 NEW PLUGINS! 🎉 🎉 🎉

flow

The graphql-codegen-flow plugin generates Flow types based on your GraphQLSchema.
It generates types for your entire schema: types, input types, enum, interface, scalar and union.

flow-documents

The graphql-codegen-flow-documents plugin generates Flow types based on your GraphQLSchema and your GraphQL documents.

It generates types for your GraphQL documents: Query, Mutation, Subscription and Fragment.

This plugin requires you to use graphql-codegen-flow as well, because it depends on it's types.

flow-resolvers

The graphql-codegen-flow-resolvers plugin generates resolvers signature based on your GraphQLSchema.

It generates types for your entire schema: types, input types, enum, interface, scalar and union.

This plugin requires you to use graphql-codegen-flow as well, because it depends on it's types.

fragment-matcher

The graphql-codegen-fragment-matcher generates a Fragment Matcher file based on your GraphQLSchema.

If you are using apollo-client and your schema contains interface or union declaration, it's recommended to fragment matcher.

You can read more about it in apollo-client documentation.

v0.14.5

Compare Source

Core / CLI

v0.14.4

Compare Source

Core / CLI

v0.14.3

Compare Source

Core / CLI

v0.14.2

Compare Source

Core / CLI

TypeScript

TypeScript Resolvers

MongoDB TypeScript Models

v0.14.1

Compare Source

CLI

v0.14.0

Compare Source

🎉🎉🎉 0.14 - New API! 🎉🎉🎉

In the previous versions of the code-generator, the configuration was confusing and passed through 3 ways: CLI flags, config file (gql-gen.json) and environment variables.

It became very confusing and difficult to use, so we decided to merge all existing configurations into a single .yml file  - codegen.yml .

We decided to go with YAML file because of the ability to create a simple, but you powerful configuration files.

This is how it looks now:

schema: schema.graphql
generates:
  types.ts:
    - typescript-common
    - typescript-server

The new CLI will also guide you through the changes you need to do in order to upgrade you usage to the latest. And you can find the complete migration guide here.

⚠️⚠️⚠️ BREAKING CHANGES ⚠️⚠️⚠️

We tried to minimize the breaking changes as much as possible, but there are some minor changes:

🤔 What else has changed? 🤔

General

  • Separated typescript template to 3 small plugin:
    • typescript-common - in charge of enums, scalars and input types - those are usually relevant for both client side and server side code. It also exports set of utils for writing TypeScript codegen plugins.
    • typescript-client - generates typings for query, mutation, subscription and fragment.
    • typescript-server - generates typing for types, interfaces, unions and fields arguments.
  • New plugin: add - which basically allow you to add custom text to the output file (replaces prepend)
  • New plugin: time - prints the current time to the output file (replace printTime)
  • New plugin: schema-ast - prints the schema using print - easy way to merge GraphQL schemas and save the output. (dotansimha/graphql-code-generator#​696)

CLI

Core

TypeScript Common Plugin

TypeScript Server Plugin

TypeScript Client Plugin

TypeScript Resolvers Plugin

React-Apollo Plugin

Angular-Apollo Plugin

TypeScript MongoDB Models Plugin

v0.13.0

Compare Source

Core

TypeScript Template

BREAKING CHANGES
  • resolvers feature move to a separate template, you can use it now as graphql-codegen-typescript-resolvers-template. Is also includes the base TypeScript template. You can just switch to graphql-codegen-typescript-resolvers-template to use it just like before.
    (dotansimha/graphql-code-generator#​742)
Bug Fixes

TypsScript Resolvers Templates

We moved the resolvers template to a separate template, and it includes all base template of typescript.

New Features
Bug Fixes

NEW TEMPLATE!!! Generates TypeScript module declaration for .graphql files

dotansimha/graphql-code-generator#​721

This template generates TypeScript typings for .graphql files containing GraphQL documents, and you can later consume it using graphql-tag/loader, and get type-check and type-safty for your imports. That also means that now when you will import from .graphql files, your IDE will provide auto-complete.

This template also handles .graphql files containing multiple GraphQL documents, and name the imports according to the operation name.

For example, if you have a query called MyQuery in my-query.graphql, this template will generate the following code:

declare module '*/my-query.graphql' {
  import { DocumentNode } from 'graphql';
  const MyQuery: DocumentNode;

  export { MyQuery };

  export default defaultDocument;
}

Later, in your code, you can use default import, or named imports:

import myQuery from './my-query.graphql';

// OR

import { myQuery } from './my-query.graphql';

React-Apollo Template

Bug fixes:

Apollo-Angular Template

Bug Fixes:

Renovate configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻️ Rebasing: Whenever PR becomes conflicted, or if you modify the PR title to begin with "rebase!".

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot. View repository job log here.

@renovate renovate bot force-pushed the renovate/graphqlcodegenerator-monorepo branch from 704f61e to 8cda534 Compare November 16, 2018 10:48
@renovate renovate bot changed the title Update dependency graphql-code-generator to v0.13.0 Update dependency graphql-code-generator to v0.14.0 Nov 16, 2018
@renovate renovate bot force-pushed the renovate/graphqlcodegenerator-monorepo branch from 8cda534 to d616d78 Compare November 17, 2018 04:06
@renovate renovate bot changed the title Update dependency graphql-code-generator to v0.14.0 Update dependency graphql-code-generator to v0.14.1 Nov 17, 2018
@codecov
Copy link

codecov bot commented Nov 17, 2018

Codecov Report

Merging #46 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #46   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           6      6           
  Lines          49     49           
  Branches        0      1    +1     
=====================================
  Hits           49     49

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fada5d2...d6d6c82. Read the comment docs.

@renovate renovate bot changed the title Update dependency graphql-code-generator to v0.14.1 Update dependency graphql-code-generator to v0.14.2 Nov 25, 2018
@renovate renovate bot force-pushed the renovate/graphqlcodegenerator-monorepo branch 2 times, most recently from 023e8a6 to 07c0ea7 Compare November 26, 2018 11:37
@renovate renovate bot changed the title Update dependency graphql-code-generator to v0.14.2 Update dependency graphql-code-generator to v0.14.3 Nov 26, 2018
@renovate renovate bot force-pushed the renovate/graphqlcodegenerator-monorepo branch from 07c0ea7 to 08c0db2 Compare November 28, 2018 10:05
@renovate renovate bot changed the title Update dependency graphql-code-generator to v0.14.3 Update dependency graphql-code-generator to v0.14.4 Nov 28, 2018
@renovate renovate bot changed the title Update dependency graphql-code-generator to v0.14.4 Update dependency graphql-code-generator to v0.14.5 Nov 29, 2018
@renovate renovate bot force-pushed the renovate/graphqlcodegenerator-monorepo branch 3 times, most recently from 150b1f5 to 2f0f07a Compare December 4, 2018 00:32
@renovate renovate bot changed the title Update dependency graphql-code-generator to v0.14.5 Update dependency graphql-code-generator to v0.15.0 Dec 13, 2018
@renovate renovate bot force-pushed the renovate/graphqlcodegenerator-monorepo branch from 2f0f07a to 96ca3c1 Compare December 13, 2018 08:17
@renovate renovate bot force-pushed the renovate/graphqlcodegenerator-monorepo branch from 96ca3c1 to d6d6c82 Compare December 17, 2018 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant