-
Notifications
You must be signed in to change notification settings - Fork 131
useLazyLoadedSchema do not support promise #1381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Look strange since because in the docs i see. async function getSchema({ req }): GraphQLSchema {
if (req.isAdmin) {
return adminSchema;
}
return userSchema;
} |
I see on the master branch export const useLazyLoadedSchema = (schemaLoader: (context: Maybe<DefaultContext>) => GraphQLSchema): Plugin => {
return {
onEnveloped({ setSchema, context }) {
setSchema(schemaLoader(context));
},
};
};
export const useAsyncSchema = (schemaPromise: Promise<GraphQLSchema>): Plugin => {
return {
onPluginInit({ setSchema }) {
schemaPromise.then(schemaObj => {
setSchema(schemaObj);
});
},
};
}; setSchema seems to expect a GraphQLSchema not a Promise |
@dotansimha I'm right? |
after some investigation, it seems the source of the issue.
For parse-server we need promise support for useLazyLoadedSchema. |
I think this is kind of resolved in the next major release we will remove useLazyLoadedSchema |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Lazy loading do not support promises.
Describe the solution you'd like
Support promises for lazyLoaded schema
Describe alternatives you've considered
No alternative found
Additional context
The text was updated successfully, but these errors were encountered: