-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
""" | ||
Test that field descriptions are present in the GQL API | ||
""" | ||
|
||
import datetime | ||
import pytest | ||
from conftest import GQLTestClient | ||
|
||
date_now = datetime.datetime.now() | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_field_description( | ||
gql_client: GQLTestClient, | ||
) -> None: | ||
""" | ||
Test that we can only fetch samples from the database that we have access to | ||
""" | ||
|
||
# Fetch all samples | ||
query = """ | ||
{ | ||
__type(name: "AutoUpdatedType") { | ||
name | ||
fields { | ||
name | ||
description | ||
} | ||
} | ||
} | ||
""" | ||
output = await gql_client.query(query, user_id=999, member_projects=[999]) | ||
fields = output["data"]["__type"]["fields"] | ||
field = {} | ||
for field in fields: | ||
if field["name"] == "name": | ||
break | ||
assert field["description"] == "This is a field description" |