I am having an issue with making a GraphQL query. I am using AWS Amplify with the Ionic app and need to make a GraphQL query to AWS AppSync. I have every query, mutation, and subscription exported as constants in ./graphql. However, when going to make the graphql request on another page, I can’t import the queries using import * as queries from './graphql/queries' so that I can use them to make graphql queries using
What a coincidence I was following the same guide! However, when I go to make the graphql query in tab1.page.ts (not home.page.ts because I am making a tabbed app and the page the query is on shouldn’t matter I think), the query isn’t even made (I verified this by trying to catch errors and log anything on the console when the ngOnInit function runs).
That is the place I’m trying to make the call. However, the NgOnit function doesn’t even run. Is there something wrong with the below code? I’m not getting any errors regarding it in my console.
@aaronksaunders I tried your code however the terminal doesn’t output NGONIT RUNS even if I run ionic serve --verbose. I was just wondering do I have to change the constructor or change something in app.module.ts or app.component.ts to get the file to run?
Thanks @aaronksaunders, it works! The query is made and I get back a response. I know this is off of topic but how can I display that data in an html file?