utils
get_environment_variable(name)
Retrieves the value of the specified environment variable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the environment variable. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The value of the environment variable. |
Raises: EnvironmentError: If the environment variable is not set.
Source code in src/ariadne/utils/utils.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
get_project_root()
Returns the path to the project root directory.
Assumes this file is at src/ariadne/utils/config.py, so the root is 3 levels up.
Source code in src/ariadne/utils/utils.py
21 22 23 24 25 26 27 28 | |
resolve_path(path)
If the path is relative, makes it absolute by prepending the project root.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
The file path to resolve. |
required |
Returns: The absolute file path as a string.
Source code in src/ariadne/utils/utils.py
49 50 51 52 53 54 55 56 57 58 59 60 61 | |