-
Notifications
You must be signed in to change notification settings - Fork 24
Description
Currently, when constructing the queries to send to the server, the compiler uses the adapters normalizeCase function. If the server is sending attributes underscored and ember expects them camelCased, overwriting the normalizeCase function in the adapter will cause the query to succeed but multi-word attributes to not display in the ember app. To get it working I had to do something like the following in my adapter:
compile(store, type, options) {
options['normalizeCaseFn'] = this.compileNormalizeCase;
return Compiler.compile(type, store, options);
},
compileNormalizeCase: function(string) {
return underscore(string);
}
and in the serializer:
normalizeCase(string) {
return underscore(string);
}
Since the normalizeCase function in the serializer is what is normally expected to be sent to the server and the normalizeCase on the adapter is used for retrieving data from the server it would make more sense to use the serializers normalizeCase function instead of the adapters.
ember-graphql-adapter/addon/adapter.js
Line 245 in 51670d2
options['normalizeCaseFn'] = this.normalizeCase; |