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

formatArgumentValidationError doesn't align to apollo formatError #259

Closed
galkin opened this issue Feb 23, 2019 · 1 comment
Closed

formatArgumentValidationError doesn't align to apollo formatError #259

galkin opened this issue Feb 23, 2019 · 1 comment
Labels
Duplicate 🔑 This issue or pull request already exists

Comments

@galkin
Copy link
Contributor

galkin commented Feb 23, 2019

Describe the bug
formatArgumentValidationError doesn't align to apollo formatError

To Reproduce

  1. Install the lastest dependencies versions:
npm install apollo-server-core type-graphql typescript
+ [email protected]
+ [email protected]
+ [email protected]
  1. Create file index.ts with such content
import { Config } from 'apollo-server-core';
import { formatArgumentValidationError } from 'type-graphql';

const options: Config = {
  formatError: formatArgumentValidationError
};
  1. Run compiling
tsc index.ts
index.ts:5:3 - error TS2322: Type '(err: GraphQLError) => { [key: string]: any; }' is not assignable to type '(error: GraphQLError) => GraphQLFormattedError'.
  Type '{ [key: string]: any; }' is missing the following properties from type 'GraphQLFormattedError': message, locations, path

5   formatError: formatArgumentValidationError
    ~~~~~~~~~~~

  node_modules/apollo-server-core/dist/graphqlOptions.d.ts:10:5
    10     formatError?: (error: GraphQLError) => GraphQLFormattedError;
           ~~~~~~~~~~~
    The expected type comes from property 'formatError' which is declared here on type 'Config'


Found 1 error.

Expected behavior
Code compiled without errors

Enviorment (please complete the following information):

  • OS: Mac
  • Node v10.15.1
  • Package version 0.16.0
  • TypeScript version 3.3.3333
@MichalLytek
Copy link
Owner

Duplicate of #258 🔒

@MichalLytek MichalLytek added the Duplicate 🔑 This issue or pull request already exists label Feb 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate 🔑 This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants