Float cannot represent non numeric value: {}

See original GitHub issue

I’ve upgraded the apollo and graphql packages to it’s latests versions; and thereby broke this package login method.

message: "Float cannot represent non numeric value: {}"
path: ["loginWithPassword", "tokenExpires"]
0: "loginWithPassword"
1: "tokenExpires"

Changed dependencies since it was working:

apollo-server-express:  1.3.6  >  2.1.0
graphql:                0.12.x > 14.0.2
graphql-tag:            1.0.x  >  2.9.2
graphql-tools:          3.0.4  >  4.0.0

meteor-apollo-accounts: 2.0.3   // unchanged

Meteor:

Meteor 1.7.0.3

accounts-password              1.5.1
apollo                         3.0.0
nicolaslopezj:apollo-accounts  3.2.2

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

2reactions
ujwal-setlurcommented, Oct 20, 2018

I have a fork. it’s meant to work with cultofcoders:apollo, but might work other apollo environments.

meteor add ujwal:apollo-accounts
1reaction
callmephilipcommented, Feb 19, 2019

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 tokenExpires returns "Invalid Date". probably need to look into the resolver on the server side

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();
  },
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

GraphQL "Float cannot represent non numeric value: Infinity"
I'm currently migrating a site from REST to graphql and I have a query that accepts a 'period' argument valuations(period: $period) { low...
Read more >
GraphQL filtering error "Float cannot represent non numeric ...
Filtering a toggle (true/false) is returning me a "float" error for some reason, even though I'm checking for a boolean. I just upgraded...
Read more >
fatal GraphQLError: Float cannot represent non numeric value
Solved ✖ fatal GraphQLError: Float cannot represent non numeric value: NaN. Hello, I got this strange issue with ackee, and I don't find...
Read more >
Float cannot represent non numeric value "NaN" error
One of our Merchants received this error when they entered our app, does anyone know any solutions to fix this or possible causes?...
Read more >
graphql - UNPKG
93, function coerceFloat(inputValue) {. 94, if (!isFinite(inputValue)) {. 95, throw new GraphQLError("Float cannot represent non numeric value: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found