Skip to content

Apollo Server 2.0 RC and typeDefs from external file #1194

@ghost

Description

Hello,

I'm currently migrating my Apollo server to v2.0 and I'm encounter an issue when trying to import typeDefs from another file.
Following the documentation (https://www.apollographql.com/docs/apollo-server/v2/migration-two-dot.html#gql-tag), it seems I need to write:

const typeDefs = gql${IMPORT_FUNCTION('./schema-file')};
or
const typeDefs = gql(IMPORT_FUNCTION('./schema-file'))

But it doesn't work, it seems to not recognize the IMPORT_FUNCTION.
Is the syntax correct? or IMPORT_FUNCTION should be replaced by something else? What should be the content of the schema_file to work correctly?

Maybe the documentation should be clearer on this point.
Thanks.

Stéphane

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions