I am trying to get the input resource key for an a...
# ask-community
c
I am trying to get the input resource key for an asset using the graphql interface. I am not sure which 'required resources' would provide this information since I am not seeing what I would expect. On every asset, I have tried getting the 'required resources' for the dependencies, the same for the op and the op's input and output definitions. None of these have the resource I would expect. Am I looking in the wrong place? I am seeing the following error in the graphql output: { "message": "'GrapheneInputDefinition' object has no attribute '_solid_def_snap'", "locations": [ { "line": 19, "column": 15 } ], "path": [ "assetsOrError", "nodes", 223, "definition", "op", "inputDefinitions", 0, "solidDefinition" ], "extensions": { "errorInfo": { "__class__": "SerializableErrorInfo", "message": "AttributeError: 'GrapheneInputDefinition' object has no attribute '_solid_def_snap'\n", "stack": [ " File \"/usr/local/lib/python3.7/site-packages/graphql/execution/execute.py\", line 521, in execute_field\n result = resolve_fn(source, info, **args)\n", " File \"/usr/local/lib/python3.7/site-packages/dagster_graphql/schema/solids.py\", line 63, in resolve_solid_definition\n return build_solid_definition(self._represented_job, self._solid_def_snap.name)\n" ], "cls_name": "AttributeError", "cause": null, "context": null } } }, Could this error be the reason I am not seeing the resource keys itemized?
🤖 1
s
Thanks for this report Chris. This looks like a bug-- this error should not be thrown. Can you post the GQL query you’re running and if possible a minimal set of definitions?
c
@sean Ok, I am trying to debug which resource is causing it but suspecting it is one I converted to the new pydantic style. Also, I notice that I can get the list of resources using the allTopLevelResource query and it provides a lot of what I am looking for except the input resource relations. However, it only works for repositories created with Definitions() and not those created with @repository. Is this expected? I also noticed that credentials are returned in this query, is this something that you will remove at some point because of security risk? I don't mind it being there since I plan to use it and close the interface from outside.
s
However, it only works for repositories created with Definitions() and not those created with @repository. Is this expected?
I believe so, because
@repository
doesn’t have a concept of “top-level” resources-- resources have to be associated to ops/assets etc
I also noticed that credentials are returned in this query
Can you provide some more detail? What query, and what field?
c
@sean the credentials are returned when querying for the configuredValues of the resource: .. on ResourceDetailsList { results { configuredValues { key type value } maybe the issue is that I should be using an environment variable and am not doing that yet.
s
yes, we need to be able to expose configured values so that’s not going to change-- the solution is to use an env var
🌈 1