• Generates an GraphQL API client that works with Amplify server context.

    Type Parameters

    • T extends Record<any, any> = never

    Parameters

    Returns V6ClientSSRRequest<T>

    Example

    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,
    }),
    });