-
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
Float cannot represent non numeric value: {} #90
Comments
Have the same issue |
The following patch fixes it:
Seems to indicate that whatever Meteor is sending for tokenExpires to graphQL is a Date, and earlier it could parse it into a float, but not anymore. Guess graphql tightened it's parser. |
A patch would be |
I am not sure, I think earlier graphql packages will also parse it as a String when the type is changed here. Remember, meteor has not changed here. |
How do you apply this patch in a production environment? Has anyone created a fork that we can use? |
I have a fork. it's meant to work with cultofcoders:apollo, but might work other apollo environments.
|
Managed to patch this as follows: import { ApolloServer } from 'apollo-server-express';
import { loadSchema, getSchema } from 'graphql-loader';
import { makeExecutableSchema } from 'graphql-tools';
import { initAccounts } from 'meteor/nicolaslopezj:apollo-accounts';
initAccounts({
loginWithFacebook: false,
loginWithGoogle: false,
loginWithLinkedIn: false,
loginWithPassword: true,
});
// RE: https://github.com/orionsoft/meteor-apollo-accounts/issues/90
const schema = getSchema();
schema.typeDefs = schema.typeDefs.replace('tokenExpires: Float!', 'tokenExpires: String!');
/* ... */ EDIT: looks like EDIT: Here's an extended patch to make sure expiration date is transmitted and parsed properly. @nicolaslopezj i'll be willing to PR if you take this // RE: https://github.com/orionsoft/meteor-apollo-accounts/issues/90
const schema = getSchema();
schema.typeDefs = schema.typeDefs.replace('tokenExpires: Float!', 'tokenExpires: String!');
_.extend(schema.resolvers.LoginMethodResponse, schema.resolvers.LoginMethodResponse, {
tokenExpires({ tokenExpires }) {
return tokenExpires.toString();
},
}); |
I've upgraded the apollo and graphql packages to it's latests versions; and thereby broke this package
login
method.Changed dependencies since it was working:
Meteor:
The text was updated successfully, but these errors were encountered: