Hello. Is there a way to easily pass static parame...
# ask-community
i
Hello. Is there a way to easily pass static parameters from job to graph so that the values of these parameters can be immediately used inside the graph?
o
hi @Ignas Kizelevičius! I mentioned this in the above thread, but I think what you're looking for here might be a graph factory pattern (similar to the op factory discussed here: https://docs.dagster.io/concepts/ops-jobs-graphs/ops#op-factory). It's also possible that you could just do this via config -- i.e. you create a values resource (https://docs.dagster.io/_apidocs/resources#dagster.make_values_resource), and supply a hard-coded value for that resource when creating your job
i
Hi @owen, thanks for the reply. Values resource looks more convenient, but can I use it directly in the graph? I mean, can I access it? I thought I can only access resources via context?
o
that's correct that you'd have to access that during execution, so it couldn't be used to define your dependency structure. if you want to vary your dependencies programmatically, you'll want the factory pattern
1