|
1 | 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
|
2 | 2 |
|
| 3 | +exports[`generateTypes amplifyJsLibraryVersion generates angular types for v5 when value is 5 or undefined 1`] = ` |
| 4 | +Object { |
| 5 | + "api.service.ts": "/* tslint:disable */ |
| 6 | +/* eslint-disable */ |
| 7 | +// This file was automatically generated and should not be edited. |
| 8 | +import { Injectable } from \\"@angular/core\\"; |
| 9 | +import API, { graphqlOperation, GraphQLResult } from \\"@aws-amplify/api-graphql\\"; |
| 10 | +import { Observable } from \\"zen-observable-ts\\"; |
| 11 | +
|
| 12 | +export interface SubscriptionResponse<T> { |
| 13 | + value: GraphQLResult<T>; |
| 14 | +} |
| 15 | +
|
| 16 | +export type Blog = { |
| 17 | + __typename: \\"Blog\\"; |
| 18 | + id: string; |
| 19 | + name: string; |
| 20 | + posts?: ModelPostConnection | null; |
| 21 | + createdAt: string; |
| 22 | + updatedAt: string; |
| 23 | +}; |
| 24 | +
|
| 25 | +export type ModelPostConnection = { |
| 26 | + __typename: \\"ModelPostConnection\\"; |
| 27 | + items: Array<Post | null>; |
| 28 | + nextToken?: string | null; |
| 29 | +}; |
| 30 | +
|
| 31 | +export type Post = { |
| 32 | + __typename: \\"Post\\"; |
| 33 | + id: string; |
| 34 | + title: string; |
| 35 | + blog?: Blog | null; |
| 36 | + comments?: ModelCommentConnection | null; |
| 37 | + createdAt: string; |
| 38 | + updatedAt: string; |
| 39 | + blogPostsId?: string | null; |
| 40 | +}; |
| 41 | +
|
| 42 | +export type ModelCommentConnection = { |
| 43 | + __typename: \\"ModelCommentConnection\\"; |
| 44 | + items: Array<Comment | null>; |
| 45 | + nextToken?: string | null; |
| 46 | +}; |
| 47 | +
|
| 48 | +export type Comment = { |
| 49 | + __typename: \\"Comment\\"; |
| 50 | + id: string; |
| 51 | + post?: Post | null; |
| 52 | + content: string; |
| 53 | + createdAt: string; |
| 54 | + updatedAt: string; |
| 55 | + postCommentsId?: string | null; |
| 56 | +}; |
| 57 | +
|
| 58 | +export type GetBlogQuery = { |
| 59 | + __typename: \\"Blog\\"; |
| 60 | + id: string; |
| 61 | + name: string; |
| 62 | + posts?: { |
| 63 | + __typename: \\"ModelPostConnection\\"; |
| 64 | + nextToken?: string | null; |
| 65 | + } | null; |
| 66 | + createdAt: string; |
| 67 | + updatedAt: string; |
| 68 | +}; |
| 69 | +
|
| 70 | +@Injectable({ |
| 71 | + providedIn: \\"root\\" |
| 72 | +}) |
| 73 | +export class APIService { |
| 74 | + async GetBlog(id: string): Promise<GetBlogQuery> { |
| 75 | + const statement = \`query GetBlog($id: ID!) { |
| 76 | + getBlog(id: $id) { |
| 77 | + __typename |
| 78 | + id |
| 79 | + name |
| 80 | + posts { |
| 81 | + __typename |
| 82 | + nextToken |
| 83 | + } |
| 84 | + createdAt |
| 85 | + updatedAt |
| 86 | + } |
| 87 | + }\`; |
| 88 | + const gqlAPIServiceArguments: any = { |
| 89 | + id |
| 90 | + }; |
| 91 | + const response = (await API.graphql( |
| 92 | + graphqlOperation(statement, gqlAPIServiceArguments) |
| 93 | + )) as any; |
| 94 | + return <GetBlogQuery>response.data.getBlog; |
| 95 | + } |
| 96 | +} |
| 97 | +", |
| 98 | +} |
| 99 | +`; |
| 100 | +
|
| 101 | +exports[`generateTypes amplifyJsLibraryVersion generates angular types for v6 when value is 6 1`] = ` |
| 102 | +Object { |
| 103 | + "api.service.ts": "/* tslint:disable */ |
| 104 | +/* eslint-disable */ |
| 105 | +// This file was automatically generated and should not be edited. |
| 106 | +import { Injectable } from \\"@angular/core\\"; |
| 107 | +import { Client, generateClient, GraphQLResult } from \\"aws-amplify/api\\"; |
| 108 | +import { Observable } from \\"rxjs\\"; |
| 109 | +
|
| 110 | +export type Blog = { |
| 111 | + __typename: \\"Blog\\"; |
| 112 | + id: string; |
| 113 | + name: string; |
| 114 | + posts?: ModelPostConnection | null; |
| 115 | + createdAt: string; |
| 116 | + updatedAt: string; |
| 117 | +}; |
| 118 | +
|
| 119 | +export type ModelPostConnection = { |
| 120 | + __typename: \\"ModelPostConnection\\"; |
| 121 | + items: Array<Post | null>; |
| 122 | + nextToken?: string | null; |
| 123 | +}; |
| 124 | +
|
| 125 | +export type Post = { |
| 126 | + __typename: \\"Post\\"; |
| 127 | + id: string; |
| 128 | + title: string; |
| 129 | + blog?: Blog | null; |
| 130 | + comments?: ModelCommentConnection | null; |
| 131 | + createdAt: string; |
| 132 | + updatedAt: string; |
| 133 | + blogPostsId?: string | null; |
| 134 | +}; |
| 135 | +
|
| 136 | +export type ModelCommentConnection = { |
| 137 | + __typename: \\"ModelCommentConnection\\"; |
| 138 | + items: Array<Comment | null>; |
| 139 | + nextToken?: string | null; |
| 140 | +}; |
| 141 | +
|
| 142 | +export type Comment = { |
| 143 | + __typename: \\"Comment\\"; |
| 144 | + id: string; |
| 145 | + post?: Post | null; |
| 146 | + content: string; |
| 147 | + createdAt: string; |
| 148 | + updatedAt: string; |
| 149 | + postCommentsId?: string | null; |
| 150 | +}; |
| 151 | +
|
| 152 | +export type GetBlogQuery = { |
| 153 | + __typename: \\"Blog\\"; |
| 154 | + id: string; |
| 155 | + name: string; |
| 156 | + posts?: { |
| 157 | + __typename: \\"ModelPostConnection\\"; |
| 158 | + nextToken?: string | null; |
| 159 | + } | null; |
| 160 | + createdAt: string; |
| 161 | + updatedAt: string; |
| 162 | +}; |
| 163 | +
|
| 164 | +@Injectable({ |
| 165 | + providedIn: \\"root\\" |
| 166 | +}) |
| 167 | +export class APIService { |
| 168 | + public client: Client; |
| 169 | + constructor() { |
| 170 | + this.client = generateClient(); |
| 171 | + } |
| 172 | + async GetBlog(id: string): Promise<GetBlogQuery> { |
| 173 | + const statement = \`query GetBlog($id: ID!) { |
| 174 | + getBlog(id: $id) { |
| 175 | + __typename |
| 176 | + id |
| 177 | + name |
| 178 | + posts { |
| 179 | + __typename |
| 180 | + nextToken |
| 181 | + } |
| 182 | + createdAt |
| 183 | + updatedAt |
| 184 | + } |
| 185 | + }\`; |
| 186 | + const gqlAPIServiceArguments: any = { |
| 187 | + id |
| 188 | + }; |
| 189 | + const response = (await this.client.graphql({ |
| 190 | + query: statement, |
| 191 | + variables: gqlAPIServiceArguments |
| 192 | + })) as any; |
| 193 | + return <GetBlogQuery>response.data.getBlog; |
| 194 | + } |
| 195 | +} |
| 196 | +", |
| 197 | +} |
| 198 | +`; |
| 199 | +
|
3 | 200 | exports[`generateTypes multipleSwiftFiles generates multiple files 1`] = `
|
4 | 201 | Object {
|
5 | 202 | "Types.graphql.swift": "// This file was automatically generated and should not be edited.
|
|
0 commit comments