Skip to content

Unhandled exception: System.ArgumentException: The source text mustn't be null or empty. (Parameter 'sourceText') #2

@Fettah

Description

@Fettah

I am integrating my graphql backend with this amazing tool but I am getting this error in AzueDevops. any idea ?

Unhandled exception: System.ArgumentException: The source text mustn't be null or empty. (Parameter 'sourceText')
   at HotChocolate.Language.Utf8GraphQLParser.Parse(String sourceText, ParserOptions options)
   at HotChocolate.Language.Utf8GraphQLParser.Parse(String sourceText)
   at SchemaCompare.SchemaComparer.DetectBreakingChanges(String oldSchema, String newSchema) in C:\github\GraphQlBreakingSchemaChangeDetector\src\SchemaCompare\SchemaComparer.cs:line 10
   at AzureDevops.AdoSchemaComparer.CreateCommentsForBreakingChanges(String file) in C:\github\GraphQlBreakingSchemaChangeDetector\src\Integration\AzureDevops\AdoSchemaComparer.cs:line 47
   at AzureDevops.AdoSchemaComparer.ReportBreakingChangesInPr(String file) in C:\github\GraphQlBreakingSchemaChangeDetector\src\Integration\AzureDevops\AdoSchemaComparer.cs:line 23
   at Cli.PrCommand.<>c.<<Create>b__0_1>d.MoveNext() in C:\github\GraphQlBreakingSchemaChangeDetector\src\Cli\PrCommand.cs:line 38
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass18_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass13_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass20_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__19_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__6_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass9_0.<<UseExceptionHandler>b__0>d.MoveNext()

Here is the code I am using:

stages:
  - stage: graphql_inspection_dotnet
    displayName: 'Graphql Inspection Dotnet'
    jobs:
      - job: graphql_inspection_job
        displayName: 'Graphql Inspection Dotnet'
        pool:
          vmImage: 'ubuntu-latest'
        steps:
          - task: UseDotNet@2
            inputs:
              version: '6.0.x'
              includePreviewVersions: false

          - checkout: self
            displayName: 'Checkout'
            clean: true
            persistCredentials: true

          - script: |
              dotnet tool install --tool-path . graphql-breaking-schema-change-detector
              cat ./apps/time-series-api/src/schema.gql
              ./breaking-change pr --file ./apps/time-series-api/src/schema.gql
            env:
              SYSTEM_ACCESSTOKEN: $(System.AccessToken)
            displayName: 'Run Breaking Change Detector'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions