ember-cli-mirage-graphql icon indicating copy to clipboard operation
ember-cli-mirage-graphql copied to clipboard

Make note of `keepGraphqlFileExtension` changing in README

Open ELepolt opened this issue 5 years ago • 1 comments

From ember-apollo-client:

DEPRECATION: [ember-apollo-client] Deprecation:
        The configuration option keepGraphqlFileExtension was not defined.
        The current default is 'false', but it will change to 'true' after the next major release.
        This option allows you to import graphql files using its extension. eg. 'import myQuery from 'my-app/queries/my-query.graphql';'
        To continue with the current behavior, explicit set it to 'false' in your 'ember-cli-build.js'.
        Please refer to 'Build time configuration' section in ember-apollo-client's README for more information.

Since this deprecation is listed I had already changed keepGraphqlFileExtension to 'true' in my ember-cli-build, which was causing the import schema to fail.

import schema from 'app-name/path-to-your-schema';

Needed to be

import schema from 'app-name/path-to-your-schema.graphql';

This took me entirely too long to realize, and thought it might be nice to make a mention to it since ember-apollo will be changing.

ELepolt avatar Dec 17 '19 21:12 ELepolt

Good observation. Thanks!

I've seen this, too. I tried to update the dummy app accordingly; however, this new import style doesn't work with some older versions of Ember. I decided not to change anything for now.

I don't know why it doesn't just work but it hasn't been important enough for me to dig deeply into the problem. If I can find some time to figure out the problem, I can update the README and the dummy app as needed.

jneurock avatar Dec 18 '19 09:12 jneurock