Skip to content

Absolute imports possible? #99

@philr35

Description

@philr35

I was wondering if absolute imports are possible. It does not seem like they work properly in create-react-app with the loader

I'm currently doing this which is not ideal:

const ADD_BOOK = loader("../../../../queries/book/list/add_book.gql");
const ALL_BOOKS = loader("../../../../queries/book/list/book_list.gql");

Any way to make this a non-relative import? I have absolute imports set for my create-react-app, but it does not work with the loader.

I would like to be able to do this:

const ADD_BOOK = loader("queries/book/list/add_book.gql");
const ALL_BOOKS = loader("queries/book/list/book_list.gql");

Any advice would be appreciated, thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions