import config from './amplifyconfiguration.json';
import { listPosts } from './graphql/queries';
const client = generateServerClient({ config });
const result = await runWithAmplifyServerContext({
nextServerContext: { request, response },
operation: (contextSpec) => client.graphql(contextSpec, {
query: listPosts,
}),
});
Generates an GraphQL API client that works with Amplify server context.