Skip to content
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

Upgrade graphql -> 14.0.3 and graphql-tools -> 4.0.3 #575

Merged
merged 1 commit into from
Dec 18, 2018
Merged

Conversation

timleslie
Copy link
Contributor

@timleslie timleslie commented Dec 16, 2018

This PR brings graphql and graphql-tools up to date with their latest releases.

https://github.com/graphql/graphql-js/releases
https://github.com/apollographql/graphql-tools/releases

The only breaking change we need to accomodate (AFAICT) relates to stricter scalar type coercion and how mongo ObjectIDs are handled.

graphql/graphql-js#1520

@timleslie timleslie assigned timleslie and unassigned jesstelford Dec 17, 2018
@timleslie timleslie changed the title Upgrade graphql -> 14.0.3 and graphql-tools -> 4.0.3 [WIP] Upgrade graphql -> 14.0.3 and graphql-tools -> 4.0.3 Dec 17, 2018
@timleslie timleslie assigned jesstelford and unassigned timleslie Dec 17, 2018
@timleslie timleslie changed the title [WIP] Upgrade graphql -> 14.0.3 and graphql-tools -> 4.0.3 Upgrade graphql -> 14.0.3 and graphql-tools -> 4.0.3 Dec 17, 2018
if (item && item.id) item.id = item.id.toString();
return item;
},
];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ These hooks are great!

@jesstelford
Copy link
Contributor

formatError API changed for error message extensions. To upgrade without changing existing server responses, wrap graphql's formatError:
import { formatError as baseFormatError, /* ... */ } from 'graphql';

{
  // other options
  formatError(error) {
    const { extensions, ...rest } = baseFormatError(error);
    return { ...extensions, ...rest };
  },
}

Might this impact some of our code?

@timleslie
Copy link
Contributor Author

formatError API changed for error message extensions. To upgrade without changing existing server responses, wrap graphql's formatError:
import { formatError as baseFormatError, /* ... */ } from 'graphql';

{
  // other options
  formatError(error) {
    const { extensions, ...rest } = baseFormatError(error);
    return { ...extensions, ...rest };
  },
}

Might this impact some of our code?

Hmm, I convinced myself that it wouldn't impact when I made the changes, but now you've got me second guessing myself. Let me explicitly verify this before I hit merge.

@jesstelford
Copy link
Contributor

Sorry for throwing doubt on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants