mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
revng.daemon: accept no arguments for analysis
Let GraphQL accept zero or more parameters for analyses.
This commit is contained in:
committed by
Massimo Fioravanti
parent
f11ed394d1
commit
41f82f657a
@@ -117,7 +117,7 @@ type {{ rank.name | capitalize }} {
|
||||
{%- if step.analyses_count() > 0 %}
|
||||
type {{ step.name }}Analyses {
|
||||
{%- for analysis in step.analyses() %}
|
||||
{{ analysis.name | normalize }}({{ analysis | generate_analysis_parameters }}): String!
|
||||
{{ analysis.name | normalize }}{{ analysis | generate_analysis_parameters }}: String!
|
||||
{%- endfor %}
|
||||
}
|
||||
{%- endif %}
|
||||
|
||||
@@ -55,8 +55,12 @@ class SchemaGenerator:
|
||||
|
||||
@staticmethod
|
||||
def _generate_analysis_parameters(analysis: Analysis) -> str:
|
||||
return ", ".join(
|
||||
f"{normalize(argument.name)}: String!" for argument in analysis.arguments()
|
||||
if len(list(analysis.arguments())) == 0:
|
||||
return ""
|
||||
return (
|
||||
"("
|
||||
+ ", ".join(f"{normalize(argument.name)}: String!" for argument in analysis.arguments())
|
||||
+ ")"
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user