Azure / data-api-builder

Data API builder provides modern REST and GraphQL endpoints to your Azure Databases and on-prem stores.
https://aka.ms/dab/docs
MIT License
949 stars 197 forks source link

[Bug]: graphql not working with Jerry walkthrough demo files #2409

Closed jbennink closed 1 month ago

jbennink commented 1 month ago

What happened?

I first installed the global tool. I then downloaded the files from the Github gist, created a local trek MSSQLLocalDB database, ran the startrek.sql script and then the startrek.cmd file. Everything ran succesful, but when I dab start and go to the /graphql endpoint it says "No schema". In the demo video Jerry did have a schema out of the box.

Is something missing in the steps not shown in de video or is something not working anymore.

Version

1.2.11+c7ca8db8558a63919c530e454c8f18b45d5b931c

What database are you using?

Azure SQL

What hosting model are you using?

Local (including CLI)

Which API approach are you accessing DAB through?

GraphQL

Relevant log output

No response

Code of Conduct

abhishekkumams commented 1 month ago

@jbennink , can you share the logs please? were you also not able to hit the rest endpoints?

jbennink commented 1 month ago

I just tried a clean dab-config with just the Actors from the video and in the F12 browser tools I see a 400 error on a query payload for operationName: "IntrospectionQuery" :

query IntrospectionQuery {
  __schema {
    queryType {
      name
    }
    mutationType {
      name
    }
    subscriptionType {
      name
    }
    types {
      ...FullType
    }
    directives {
      name
      description
      isRepeatable
      args {
        ...InputValue
      }
      locations
    }
  }
}

fragment FullType on __Type {
  kind
  name
  description
  specifiedByURL
  isOneOf
  fields(includeDeprecated: true) {
    name
    description
    args {
      ...InputValue
    }
    type {
      ...TypeRef
    }
    isDeprecated
    deprecationReason
  }
  inputFields {
    ...InputValue
  }
  interfaces {
    ...TypeRef
  }
  enumValues(includeDeprecated: true) {
    name
    description
    isDeprecated
    deprecationReason
  }
  possibleTypes {
    ...TypeRef
  }
}

fragment InputValue on __InputValue {
  name
  description
  type {
    ...TypeRef
  }
  defaultValue
}

fragment TypeRef on __Type {
  kind
  name
  ofType {
    kind
    name
    ofType {
      kind
      name
      ofType {
        kind
        name
        ofType {
          kind
          name
          ofType {
            kind
            name
          }
        }
      }
    }
  }
}

which results in a Response:

{
    "errors": [
        {
            "message": "The field `isOneOf` does not exist on the type `__Type`.",
            "locations": [
                {
                    "line": 32,
                    "column": 3
                }
            ],
            "path": [
                "__schema",
                "types"
            ],
            "extensions": {
                "type": "__Type",
                "field": "isOneOf",
                "responseName": "isOneOf",
                "specifiedBy": "http://spec.graphql.org/October2021/#sec-Field-Selections-on-Objects-Interfaces-and-Unions-Types"
            }
        }
    ]
}
jbennink commented 1 month ago

abhishekkumams the rest endpoint and the swagger both work. As seen in the added comment it seems like a specific errro on the graphql -- javascript -- code?

jbennink commented 1 month ago

abhishekkumams Like I said, console output is all ok, the UI does not give any errors, except I looked with F12 in the brwoser and got the message shown above.

Looks alomost like an issue with a newerer graphql component?

jbennink commented 1 month ago

Went back tot 1.2.10 and 1.1.7 but still the same problem/erro in de F12 tools on a call to /graphql for the IntrospectionQuery operation

jbennink commented 1 month ago

Hmm, might be related to this issue from 16 hours ago: https://github.com/ChilliCream/graphql-platform/issues/7569

They mention there they found the bug in Hot Chocolota and will have a fix today. Just my luck I started looking at this today.

abhishekkumams commented 1 month ago

Thanks for the details. we would be monitoring from our side as well.

michaelstaib commented 1 month ago

That one is on us. The bug is only happening when switching on the experimental feature of oneOf. We have now integrated oneOf support into BCP so you see it in the schema explorer etc and that caused the issue. There will be a bugfix later today.

michaelstaib commented 1 month ago

This one is now fixed and should work again.

abhishekkumams commented 1 month ago

@jbennink , Is this issue resolved for you now?

seantleonard commented 1 month ago

Please reopen if you are still experiencing issues. Michael has deployed the fix for BCP