Skip to content

Commit

Permalink
test(graphql-generator): regenerated snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
Equartey committed Apr 18, 2024
1 parent 456375d commit 702754b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ class Blog extends amplify_core.Model {
Blog.fromJson(Map<String, dynamic> json)
: id = json['id'],
_name = json['name'],
_posts = json['posts'] is List
? (json['posts'] as List)
.where((e) => e?['serializedData'] != null)
.map((e) => Post.fromJson(new Map<String, dynamic>.from(e['serializedData'])))
_posts = json['posts'] != null
? (json['posts']['items'] as List)
.where((e) => e != null)
.map((e) => Post.fromJson(new Map<String, dynamic>.from(e)))
.toList()
: null,
_createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null,
Expand Down Expand Up @@ -416,8 +416,8 @@ class Comment extends amplify_core.Model {
Comment.fromJson(Map<String, dynamic> json)
: id = json['id'],
_post = json['post']?['serializedData'] != null
? Post.fromJson(new Map<String, dynamic>.from(json['post']['serializedData']))
_post = json['post'] != null
? Post.fromJson(new Map<String, dynamic>.from(json['post']))
: null,
_content = json['content'],
_createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null,
Expand Down Expand Up @@ -738,13 +738,13 @@ class Post extends amplify_core.Model {
Post.fromJson(Map<String, dynamic> json)
: id = json['id'],
_title = json['title'],
_blog = json['blog']?['serializedData'] != null
? Blog.fromJson(new Map<String, dynamic>.from(json['blog']['serializedData']))
_blog = json['blog'] != null
? Blog.fromJson(new Map<String, dynamic>.from(json['blog']))
: null,
_comments = json['comments'] is List
? (json['comments'] as List)
.where((e) => e?['serializedData'] != null)
.map((e) => Comment.fromJson(new Map<String, dynamic>.from(e['serializedData'])))
_comments = json['comments'] != null
? (json['comments']['items'] as List)
.where((e) => e != null)
.map((e) => Comment.fromJson(new Map<String, dynamic>.from(e)))
.toList()
: null,
_createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,12 @@ Object {
/* eslint-disable */
// This file was automatically generated and should not be edited.
import { Injectable } from \\"@angular/core\\";
import { Client, generateClient, GraphQLResult } from \\"aws-amplify/api\\";
import { Observable } from \\"rxjs\\";
import API, { graphqlOperation, GraphQLResult } from \\"@aws-amplify/api-graphql\\";
import { Observable } from \\"zen-observable-ts\\";
export interface SubscriptionResponse<T> {
value: GraphQLResult<T>;
}
export type Blog = {
__typename: \\"Blog\\";
Expand Down Expand Up @@ -165,10 +169,6 @@ export type GetBlogQuery = {
providedIn: \\"root\\"
})
export class APIService {
public client: Client;
constructor() {
this.client = generateClient();
}
async GetBlog(id: string): Promise<GetBlogQuery> {
const statement = \`query GetBlog($id: ID!) {
getBlog(id: $id) {
Expand All @@ -186,10 +186,9 @@ export class APIService {
const gqlAPIServiceArguments: any = {
id
};
const response = (await this.client.graphql({
query: statement,
variables: gqlAPIServiceArguments
})) as any;
const response = (await API.graphql(
graphqlOperation(statement, gqlAPIServiceArguments)
)) as any;
return <GetBlogQuery>response.data.getBlog;
}
}
Expand Down

0 comments on commit 702754b

Please sign in to comment.