Closed nlfiedler closed 3 years ago
Hm, to be honest, it's very difficult to tell, because there is not a lot of information. The error seems to be:
throw new Error('Invalid or incomplete schema, unknown type: ' + typeName + '. Ensure ' + 'that a full introspection query is used in order to build a ' + 'client schema.');
angel_graphql
2.0 is still in beta, so I wouldn't expect it to be bug-free for the time being. I'll leave this open, because there's more digging to do to find what the underlying cause is (and graphiql's error message is not very descriptive at all).
It happens with angel_graphql
1.0 as well, when defining a custom type. With either 1.0 or 2.0, if you are not using a type outside of the graphql_schema
package, then it's fine. But yeah, there's not much else to go on here, sorry.
Ah, wait. Here's a workaround - the GraphQL constructor takes an
additionalTypes
argument, which can be used to add types to the schema
directly. The introspector should automatically pick up any types from
your given schema, though, so I guess that's what will need to change.
On Sun, Mar 1, 2020 at 7:53 PM Nathan Fiedler notifications@github.com wrote:
It happens with angel_graphql 1.0 as well, when defining a custom type. With either 1.0 or 2.0, if you are not using a type outside of the graphql_schema package, then it's fine. But yeah, there's not much else to go on here, sorry.
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/angel-dart/angel/issues/241?email_source=notifications&email_token=ACMIUPB2LPBO2VC2J3773KTRFL7R5A5CNFSM4K7BG5Q2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENNSAQI#issuecomment-593174593, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACMIUPEZV5UIKONLZE4M4QTRFL7R5ANCNFSM4K7BG5QQ .
--
Tobe Osakwe Student, B.S. Comp. Sci, Florida State University https://thosakwe.com
Thanks for the suggestion. I found the customTypes
and tried that:
final graphql = GraphQL(
graphQLSchema(
queryType: queryType,
mutationType: mutationType,
),
customTypes: [
bigIntType,
graphQLUpload,
],
);
But that change did not resolve the error. I'm guessing something else must be done with the custom types further down the line.
Using either
angel_graphql
1.0 and defining a custom scalar (e.g.BigInt
), or usingangel_graphql
2.0 and using theUpload
type, an exception is displayed in the results panel of the GraphiQL interface. Maybe something about the type definition is not what graphiql expected? Maybe I'm missing something?