question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parsing silently fails for mutations

See original GitHub issue

Consider this example:

# Schema
type LogInput {
  message: String!
  createdAt: Date!
}

type Log {
  id: ID!
  message: String!
  createdAt: Date!
}

type Mutation {
  createLog(log: LogInput!): Log!
}

# query
mutation {
  createLog({
    message: "Hello, World!",
    createdAt: "2017-01-001" # invalid
  }) {
    message,
    createdAt
  }
}

In this example, parsing silently fails and sets the createdAt to null. I think it would be more useful to thrown an error in this case.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
excitement-engineercommented, Feb 3, 2018

I have release version 3.4.0 which includes the fix.

0reactions
jhnferrariscommented, Apr 11, 2018

Can anyone confirm if the parsing silently fails on GraphQLDateTime on version ^3.5.0 with graphql version 0.13.2?

I have this schema snippet

input payload{
    durationStart: GraphQLDateTime!
    durationEnd: GraphQLDateTime!
  }

mutation {
  sendSchedule(payload: {
    durationStart:"04-04 14:59:59xxxxx" # invalid
    durationEnd: "2018-04-04T15:00:00"
  }) {
     durationStart
     durationEnd
  }
}

In the resolver args.payload log is showing:

durationStart: '04-04 14:59:59xxxxx',
durationEnd: '2018-04-04T15:00:00

therefore it is “passing”?

Thanks for the assist!

UPDATE:

My bad. I just set it up the wrong way. 😄 I referred here for the solution: https://github.com/excitement-engineer/graphql-iso-date/issues/37#issuecomment-304286628

Read more comments on GitHub >

github_iconTop Results From Across the Web

Discussion: TypeScript compile errors with mutation switching ...
I don't want to be parsing all input files (seriously, it is already a pain to parse only the files to be mutated)...
Read more >
Mutation fails on upload file with Parse error - FAQs
Hi @mpaon! It looks like you're using a variable to try and add a local file to an item's file column without defining...
Read more >
How to Write Better Code Using Mutation Testing | Cognito
Mutation testing is not an alternative to line coverage. While line coverage asks “what percentage of our code is run by our tests,” ......
Read more >
DNS parser, meet Go fuzzer - The Cloudflare Blog
Fuzzing is the technique of testing software by continuously feeding it inputs that are automatically mutated. For C/C++, the wildly successful ...
Read more >
Python: comparing two multi-fasta files of the same set of ...
My question: How can I zip the parsers together to count the mutations? from Bio import SeqIO for normal_samples in SeqIO.parse ...
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