graphql-platform: Error SS0006 when custom scalar type begins with lowercase letter (and used as query argument)

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

UPDATE Changing title to reflect that this is happening for any custom scalar that begins with a lowercase letter. Does not appear to have anything to do with Hasura or uuid.

I am attempting to use StrawberryShake with a Hasura endpoint. Fully appreciate that this is pretty bleeding edge, thank you for building an alternative to graphql-dotnet.

Hasura uses a custom scalar for uuid, and I’m running into problems when authoring queries that accept it as an argument. I’ve attached the schema file generated from a fresh Hasura instance with a single items table. This table only has two columns: id (uuid) and name (text). For testing I added two rows only: “foo” and "bar.

schema.graphql.txt

Attempting to build this query, with or without using it, results in a SS0006 error:

query GetItemsById($item_id: uuid!) {
  items(where: {id: {_eq: $item_id}}) {
    id
    name
  }
}

I am able to use a nearly identical query to get items by name successfully:

query GetItemsByName($item_name: String!) {
  items(where: {name: {_eq: $item_name}}) {
    id
    name
  }
}

Here is the test client I used:

using System;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;

namespace ss_test
{
    class Program
    {
        static async Task Main(string[] args)
        {
            var serviceCollection = new ServiceCollection();

            serviceCollection
                .AddTestClient()
                .ConfigureHttpClient(client => client.BaseAddress = new Uri("http://localhost:8080/v1/graphql"));
            
            IServiceProvider services = serviceCollection.BuildServiceProvider();

            ITestClient client = services.GetRequiredService<ITestClient>();

            var result = await client.GetItems.ExecuteAsync();
            foreach (var item in result.Data.Items)
                Console.WriteLine(item.Name);
            
            var result2 = await client.GetItemsByName.ExecuteAsync("foo");
            foreach (var item in result2.Data.Items)
                Console.WriteLine(item.Name);

            // FIXME: simply including GetItemsById.graphql in build produces this error:
            //        CSC : error SS0006: Sequence contains no matching element
            //var result3 = await client.GetItemsById.ExecuteAsync("c52dbb49-f578-473d-91c4-dd1212753c46");
            //foreach (var item in result3.Data.Items)
            //    Console.WriteLine(item.Name);
        }
    }
}

Steps to reproduce

  1. Start clean Hasura dev instance using docker container
  2. Add single table items with columns: id (uuid auto) and name (text)
  3. Add two rows: foo, bar
  4. Follow console StrawberryShake tutorial
  5. Attempt to build query to get items by id (see bug description)

Relevant log output

dotnet build
Microsoft (R) Build Engine version 16.11.0+0538acc04 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
CSC : error SS0006: Sequence contains no matching element [/home/josh/projects/ss-test/ss-test.csproj]

Build FAILED.

CSC : error SS0006: Sequence contains no matching element [/home/josh/projects/ss-test/ss-test.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.82

Additional Context?

No response

Product

Strawberry Shake

Version

11.3.7

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

We will put it on the first 13 builds starting this week.