Open laayis opened 5 years ago
I'm not positive but maybe try view_func= cognito_auth_required(GraphQLView.as_view( ...
a decorator is just a function that takes a function and returns a function
Yes, you can do as @revmischa says. I've done something like this but in a separate function:
def graphql_view():
view = GraphQLView.as_view('graphql', schema=schema, graphiql=True)
return cognito_auth_required(view)
app.add_url_rule('/graphql', view_func=graphql_view())
Hi am very new to flask. How can one use this library with the add_url_rule() method for authentication?
app.add_url_rule( '/example', #the endpoint view_func=GraphQLView.as_view( #setting the view function 'lta',
we set the schema that we generate