-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
getUser does not currently populate it's .robots
of .robots.sessions
fields. But when doing the fix in users.toml
:
query QUERY_GET_USER (
$userLabel: EmailAddress!
) {
users (where: {label: $userLabel}) {
...FRAGMENT_USER
robots {
...FRAGMENT_ROBOT
sessions {
...FRAGMENT_SESSION
}
}
}
}
A new duplicate fragments error with gql occurs. See error stack below...
The error relates to BLOBENTRY GQL fragment being loaded multiple times in the nested user-robot-sessions GQL above. There is chatter on this issue for Python's GQL in general, e.g.:
- Likely solved similar to JS: Duplicated nested fragments on code generation dotansimha/graphql-code-generator#4684 (comment)
- Dropping interpolated for symbolic nesting only: Introduce
dedupeFragments
config flag for dealing with duplicate fragments dotansimha/graphql-code-generator#6018 (comment) - Next best solution: https://gist.github.com/lanwin/bdc33d0bf291851bda48d17f98b98ff2
- Original solution: Fragments bodies where added multiple times (duplicates) apollographql/graphql-tag#278
- More info: Generation of Duplicated Fragments in nested fragments dotansimha/graphql-code-generator#3063
Note the query above works in playground, and also already released via SDK.jl.
In : usr = await getUser(ngc, userLabel)
Traceback (most recent call last):
File "/usr/lib/python3.8/asyncio/__main__.py", line 58, in runcode
return future.result()
File "/usr/lib/python3.8/concurrent/futures/_base.py", line 444, in result
return self.__get_result()
File "/usr/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
raise self._exception
File "<console>", line 1, in <module>
File "/home/dehann/software/NavAbility/NavAbilitySDK.py/src/navability/services/user.py", line 34, in getUser
resp = await navAbilityClient.query(
File "/home/dehann/software/NavAbility/NavAbilitySDK.py/src/navability/entities/navabilityclient.py", line 81, in query
result = await client.execute(options.query, options.variables)
File "/home/dehann/.local/lib/python3.8/site-packages/gql/client.py", line 408, in execute
result = await self._execute(document, *args, **kwargs)
File "/home/dehann/.local/lib/python3.8/site-packages/gql/client.py", line 393, in _execute
self.client.validate(document)
File "/home/dehann/.local/lib/python3.8/site-packages/gql/client.py", line 117, in validate
raise validation_errors[0]
graphql.error.graphql_error.GraphQLError: There can be only one fragment named 'FRAGMENT_BLOBENTRY'.
GraphQL request:13:10
12 |
13 | fragment FRAGMENT_BLOBENTRY on BlobEntry {
| ^
14 | id
GraphQL request:49:10
48 |
49 | fragment FRAGMENT_BLOBENTRY on BlobEntry {
| ^
50 | id
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working