Skip to content

Commit

Permalink
Fix env var conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
noah-paige committed Nov 19, 2024
1 parent 0941dc2 commit 1270abe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions backend/api_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
for name in ['boto3', 's3transfer', 'botocore', 'boto']:
logging.getLogger(name).setLevel(logging.ERROR)

SCHEMA_EXPLORATION = True if os.getenv('SCHEMA_EXPLORATION') == 'True' else False
ALLOW_INTROSPECTION = True if os.getenv('ALLOW_INTROSPECTION') == 'True' else False

if SCHEMA_EXPLORATION:
if not ALLOW_INTROSPECTION:
did_you_mean.__globals__['MAX_LENGTH'] = 0

load_modules(modes={ImportMode.API})
Expand Down Expand Up @@ -145,7 +145,7 @@ def handler(event, context):
raise Exception(f'Could not initialize user context from event {event}')

success, response = graphql_sync(
schema=executable_schema, data=query, context_value=app_context, introspection=SCHEMA_EXPLORATION
schema=executable_schema, data=query, context_value=app_context, introspection=ALLOW_INTROSPECTION
)

dispose_context()
Expand Down
2 changes: 1 addition & 1 deletion deploy/stacks/lambda_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def __init__(
'LOG_LEVEL': log_level,
'REAUTH_TTL': str(reauth_ttl),
'ALLOWED_ORIGINS': allowed_origins,
'SCHEMA_EXPLORATION': str(prod_sizing),
'ALLOW_INTROSPECTION': str(not prod_sizing),
}
# Check if custom domain exists and if it exists email notifications could be enabled. Create a env variable which stores the domain url. This is used for sending data.all share weblinks in the email notifications.
if custom_domain and custom_domain.get('hosted_zone_name', None):
Expand Down

0 comments on commit 1270abe

Please sign in to comment.