I'm using Nuxt3 and Vite (which use VueJS behind the scenes), and I get this error when trying to construct a GraphQL query.
import { API, graphqlOperation } from 'aws-amplify';
import { listComments } from '~/src/graphql/queries';
import { ListCommentsQuery } from '~/src/graphql/queries';
import { GraphQLQuery } from '@aws-amplify/api-graphql';
// I've also tried: import { GraphQLQuery } from '@aws-amplify/api';
const comments = API.graphql < GraphQLQuery < ListCommentsQuery >> (
graphqlOperation(listComments)
)
console.log(comments)
Error:
ambiguous indirect export: GraphQLQuery