-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated interface support #121
Conversation
70e28e0
to
f93a7d2
Compare
src/decode.js
Outdated
@@ -116,11 +116,13 @@ function transformScalars(context, value) { | |||
} | |||
|
|||
function recordTypeInformation(context, value) { | |||
const selectionSet = context.selection.selectionSet; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for reference, you can also destructure the context.selection.selectionSet
like this:
const {typeBundle, typeSchema} = context.selection.selectionSet;
This way you can directly use the typeBundle
and typeSchema
constants afterwards.
test/schema-type-test.js
Outdated
@@ -3,6 +3,7 @@ import typeBundle from '../fixtures/custom-type-bundle'; | |||
import schemaForType from '../src/schema-for-type'; | |||
import Query from '../src/query'; | |||
import Mutation from '../src/mutation'; | |||
import realTypeBundle from '../fixtures/types'; // eslint-disable-line import/no-unresolved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure about the naming here. It may be better to call typeBundle
customTypeBundleand this one
typeBundleor something.
realTypeBundle` just raises all sorts of questions about what the other bundle is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're completely right. I will rename this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one small potential naming change. This is great otherwise tho. Thanks for digging through this project and getting this change in 🙌🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
57f8842
to
83d8164
Compare
83d8164
to
6674a46
Compare
Adds support for falling back when interface objects can't be translated.
Relates to Shopify/js-buy-sdk#614
I'm trying to fix the situation in the linked issue, which is outlined below:
DiscountApplication
)AutomaticDiscountApplication
)AutomaticDiscountApplication
objects to an old version of the client, which does not have a definition for it in the schema. Instead of failing silently / falling back, the queryreturns an error.