Skip to content

Latest commit

 

History

History
90 lines (78 loc) · 1.46 KB

README.md

File metadata and controls

90 lines (78 loc) · 1.46 KB

Graphql Dotnet Timespan Bug

This repository is to demonstrate an issue with Seconds to Timespan type.

Instructions

  1. dotnet watch run (or start the debug task on VS Code)
  2. Navigate to http://localhost:5000
  3. Run the Get Item operation detailed below to see expected result
    {
        "data": {
            "getItem": {
                "intField": 1000,
                "timeSpanField": 30600
            }
        }
    }
    
  4. Run the Set Item, No Query Variables operation detailed below to see expected result
    {
        "data": {
            "setItem": {
                "intField": 500,
                "timeSpanField": 1500
            }
        }
    }
    
  5. Run the Set Item, With Query Variables operation detailed below to see expected (incorrect) result
    {
        "data": {
            "setItem": {
                "intField": 2000,
                "timeSpanField": 0
            }
        }
    }
    

Operations

Get Item

query {
  getItem {
    intField
    timeSpanField
  }
}

Set Item, No Query Variables

mutation {
  setItem(input: {
    intField: 500,
    timeSpanField: 1500
  }) {
    intField
    timeSpanField
  }
}

Set Item, With Query Variables

mutation($input: ItemInputType!) {
  setItem(input: $input) {
    intField
    timeSpanField
  }
}

and Query Variables of

{
  "input": {
    "intField": 2000,
    "timeSpanField": 1500
  }
}