Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(amplify-graphql-types-generator): use zen-observable-ts #4415

Merged
merged 2 commits into from
Jun 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function generateSource(context: LegacyCompilerContext) {
generator.printOnNewline(`import API, { graphqlOperation } from '@aws-amplify/api';`);
generator.printOnNewline(`import { GraphQLResult } from "@aws-amplify/api/lib/types";`);

generator.printOnNewline(`import * as Observable from 'zen-observable';`);
generator.printOnNewline(`import { Observable } from 'zen-observable-ts';`);
generator.printNewline();

generateTypes(generator, context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`Angular code generation #generateSource() should generate correct list
import { Injectable } from \\"@angular/core\\";
import API, { graphqlOperation } from \\"@aws-amplify/api\\";
import { GraphQLResult } from \\"@aws-amplify/api/lib/types\\";
import * as Observable from \\"zen-observable\\";
import { Observable } from \\"zen-observable-ts\\";

// The episodes in the Star Wars trilogy
export enum Episode {
Expand Down Expand Up @@ -87,7 +87,7 @@ exports[`Angular code generation #generateSource() should generate fragmented qu
import { Injectable } from \\"@angular/core\\";
import API, { graphqlOperation } from \\"@aws-amplify/api\\";
import { GraphQLResult } from \\"@aws-amplify/api/lib/types\\";
import * as Observable from \\"zen-observable\\";
import { Observable } from \\"zen-observable-ts\\";

export type HeroAndFriendsNamesQuery = {
__typename: \\"Character\\";
Expand Down Expand Up @@ -177,7 +177,7 @@ exports[`Angular code generation #generateSource() should generate mutation oper
import { Injectable } from \\"@angular/core\\";
import API, { graphqlOperation } from \\"@aws-amplify/api\\";
import { GraphQLResult } from \\"@aws-amplify/api/lib/types\\";
import * as Observable from \\"zen-observable\\";
import { Observable } from \\"zen-observable-ts\\";

// The episodes in the Star Wars trilogy
export enum Episode {
Expand Down Expand Up @@ -247,7 +247,7 @@ exports[`Angular code generation #generateSource() should generate queries retur
import { Injectable } from \\"@angular/core\\";
import API, { graphqlOperation } from \\"@aws-amplify/api\\";
import { GraphQLResult } from \\"@aws-amplify/api/lib/types\\";
import * as Observable from \\"zen-observable\\";
import { Observable } from \\"zen-observable-ts\\";

export type CustomScalarQuery = {
__typename: \\"QueryObject\\";
Expand Down Expand Up @@ -279,7 +279,7 @@ exports[`Angular code generation #generateSource() should generate query operati
import { Injectable } from \\"@angular/core\\";
import API, { graphqlOperation } from \\"@aws-amplify/api\\";
import { GraphQLResult } from \\"@aws-amplify/api/lib/types\\";
import * as Observable from \\"zen-observable\\";
import { Observable } from \\"zen-observable-ts\\";

export type HeroAndDetailsQuery = {
__typename: \\"Character\\";
Expand Down Expand Up @@ -325,7 +325,7 @@ exports[`Angular code generation #generateSource() should generate simple nested
import { Injectable } from \\"@angular/core\\";
import API, { graphqlOperation } from \\"@aws-amplify/api\\";
import { GraphQLResult } from \\"@aws-amplify/api/lib/types\\";
import * as Observable from \\"zen-observable\\";
import { Observable } from \\"zen-observable-ts\\";

// The episodes in the Star Wars trilogy
export enum Episode {
Expand Down Expand Up @@ -393,7 +393,7 @@ exports[`Angular code generation #generateSource() should generate simple nested
import { Injectable } from \\"@angular/core\\";
import API, { graphqlOperation } from \\"@aws-amplify/api\\";
import { GraphQLResult } from \\"@aws-amplify/api/lib/types\\";
import * as Observable from \\"zen-observable\\";
import { Observable } from \\"zen-observable-ts\\";

export type StarshipCoordsQuery = {
__typename: \\"Starship\\";
Expand Down Expand Up @@ -425,7 +425,7 @@ exports[`Angular code generation #generateSource() should generate simple query
import { Injectable } from \\"@angular/core\\";
import API, { graphqlOperation } from \\"@aws-amplify/api\\";
import { GraphQLResult } from \\"@aws-amplify/api/lib/types\\";
import * as Observable from \\"zen-observable\\";
import { Observable } from \\"zen-observable-ts\\";

@Injectable({
providedIn: \\"root\\"
Expand Down Expand Up @@ -455,7 +455,7 @@ exports[`Angular code generation #generateSource() should generate simple query
import { Injectable } from \\"@angular/core\\";
import API, { graphqlOperation } from \\"@aws-amplify/api\\";
import { GraphQLResult } from \\"@aws-amplify/api/lib/types\\";
import * as Observable from \\"zen-observable\\";
import { Observable } from \\"zen-observable-ts\\";

export type HeroNameQuery = {
__typename: \\"Character\\";
Expand Down Expand Up @@ -488,7 +488,7 @@ exports[`Angular code generation #generateSource() should generate simple query
import { Injectable } from \\"@angular/core\\";
import API, { graphqlOperation } from \\"@aws-amplify/api\\";
import { GraphQLResult } from \\"@aws-amplify/api/lib/types\\";
import * as Observable from \\"zen-observable\\";
import { Observable } from \\"zen-observable-ts\\";

// The episodes in the Star Wars trilogy
export enum Episode {
Expand Down Expand Up @@ -534,7 +534,7 @@ exports[`Angular code generation #generateSource() should handle comments in enu
import { Injectable } from \\"@angular/core\\";
import API, { graphqlOperation } from \\"@aws-amplify/api\\";
import { GraphQLResult } from \\"@aws-amplify/api/lib/types\\";
import * as Observable from \\"zen-observable\\";
import { Observable } from \\"zen-observable-ts\\";

export enum EnumCommentTestCase {
first = \\"first\\", // This is a single-line comment
Expand Down Expand Up @@ -573,7 +573,7 @@ exports[`Angular code generation #generateSource() should handle interfaces at r
import { Injectable } from \\"@angular/core\\";
import API, { graphqlOperation } from \\"@aws-amplify/api\\";
import { GraphQLResult } from \\"@aws-amplify/api/lib/types\\";
import * as Observable from \\"zen-observable\\";
import { Observable } from \\"zen-observable-ts\\";

export type CustomScalarQuery = {
__typename: \\"InterfaceTestCase\\";
Expand Down Expand Up @@ -611,7 +611,7 @@ exports[`Angular code generation #generateSource() should handle multi-line comm
import { Injectable } from \\"@angular/core\\";
import API, { graphqlOperation } from \\"@aws-amplify/api\\";
import { GraphQLResult } from \\"@aws-amplify/api/lib/types\\";
import * as Observable from \\"zen-observable\\";
import { Observable } from \\"zen-observable-ts\\";

export type CustomScalarQuery = {
__typename: \\"CommentTest\\";
Expand Down Expand Up @@ -645,7 +645,7 @@ exports[`Angular code generation #generateSource() should handle single line com
import { Injectable } from \\"@angular/core\\";
import API, { graphqlOperation } from \\"@aws-amplify/api\\";
import { GraphQLResult } from \\"@aws-amplify/api/lib/types\\";
import * as Observable from \\"zen-observable\\";
import { Observable } from \\"zen-observable-ts\\";

export type CustomScalarQuery = {
__typename: \\"CommentTest\\";
Expand Down Expand Up @@ -678,7 +678,7 @@ exports[`Angular code generation #generateSource() should handle unions at root
import { Injectable } from \\"@angular/core\\";
import API, { graphqlOperation } from \\"@aws-amplify/api\\";
import { GraphQLResult } from \\"@aws-amplify/api/lib/types\\";
import * as Observable from \\"zen-observable\\";
import { Observable } from \\"zen-observable-ts\\";

export type CustomScalarQuery = {
__typename: \\"PartialA\\" | \\"PartialB\\";
Expand Down Expand Up @@ -714,7 +714,7 @@ exports[`Angular code generation #generateSource() should have __typename value
import { Injectable } from \\"@angular/core\\";
import API, { graphqlOperation } from \\"@aws-amplify/api\\";
import { GraphQLResult } from \\"@aws-amplify/api/lib/types\\";
import * as Observable from \\"zen-observable\\";
import { Observable } from \\"zen-observable-ts\\";

export type HeroNameQuery = {
__typename: \\"Character\\";
Expand Down Expand Up @@ -759,7 +759,7 @@ exports[`Angular code generation #generateSource() should have __typename value
import { Injectable } from \\"@angular/core\\";
import API, { graphqlOperation } from \\"@aws-amplify/api\\";
import { GraphQLResult } from \\"@aws-amplify/api/lib/types\\";
import * as Observable from \\"zen-observable\\";
import { Observable } from \\"zen-observable-ts\\";

export type DroidNameQuery = {
__typename: \\"Droid\\";
Expand Down Expand Up @@ -798,7 +798,7 @@ exports[`Angular code generation #generateSource() should have the correct __typ
import { Injectable } from \\"@angular/core\\";
import API, { graphqlOperation } from \\"@aws-amplify/api\\";
import { GraphQLResult } from \\"@aws-amplify/api/lib/types\\";
import * as Observable from \\"zen-observable\\";
import { Observable } from \\"zen-observable-ts\\";

export type FindHumanQuery = {
__typename: \\"Human\\";
Expand Down