You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new to Ariadne and a python novice. I'm trying to complete a hands on learning session with Ariadne. I'm given a schema.graphql file (attached) with all the settings. I'm tasked with 2 things.
add some code to prevent a batched query with more that 5 queries.
if there are more than 5 queries in a batch query throw a 429 error.
I'm given the code below to add. I assume i just change the '?' to 5. But i'm not sure how to incorporate this to schema.grpahql.
I believe i need to add something to the PostResult and PostsResult functions, but i can't figure out what to add.
Can someone help me to get the correct syntax? And where i need to make changes?
################################################
success, result = graphql_sync(
schema,
data,
context_value=request,
validation_rules=[cost_validator(maximum_cost=?)]
#################################################
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm new to Ariadne and a python novice. I'm trying to complete a hands on learning session with Ariadne. I'm given a schema.graphql file (attached) with all the settings. I'm tasked with 2 things.
I'm given the code below to add. I assume i just change the '?' to 5. But i'm not sure how to incorporate this to schema.grpahql.
I believe i need to add something to the PostResult and PostsResult functions, but i can't figure out what to add.
Can someone help me to get the correct syntax? And where i need to make changes?
################################################
success, result = graphql_sync(
schema,
data,
context_value=request,
validation_rules=[cost_validator(maximum_cost=?)]
#################################################
schema.graphql.txt
)
Beta Was this translation helpful? Give feedback.
All reactions