def visit_deprecated_directive(self, obj): return ast.DirectiveNode( name=_name('deprecated'), arguments=[ ast.ArgumentNode( name=_name('reason'), value=ast.StringValueNode(value=obj.reason), ), ], )
def visit_requires_directive(self, obj): return ast.DirectiveNode( name=_name('requires'), arguments=[ ast.ArgumentNode( name=_name('fields'), value=ast.StringValueNode(value=obj.fields), ), ], )
def _build_stitch_directive(source_field_name, sink_field_name): """Build a Directive node for the stitch directive.""" return ast_types.DirectiveNode( name=ast_types.NameNode(value="stitch"), arguments=[ ast_types.ArgumentNode( name=ast_types.NameNode(value="source_field"), value=ast_types.StringValueNode(value=source_field_name), ), ast_types.ArgumentNode( name=ast_types.NameNode(value="sink_field"), value=ast_types.StringValueNode(value=sink_field_name), ), ], )
def visit_extends_directive(self, obj): return ast.DirectiveNode(name=_name('extends'))