Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
131 | public function export(string $endpoint, bool $json = false): string |
||
132 | { |
||
133 | $schema = $this->compiler->compile($endpoint); |
||
134 | |||
135 | if ($json) { |
||
136 | $result = GraphQL::executeQuery($schema, self::INTROSPECTION_QUERY); |
||
137 | |||
138 | return json_encode($result->toArray(), JSON_PRETTY_PRINT); |
||
139 | } |
||
140 | |||
141 | return SchemaPrinter::doPrint($schema); |
||
142 | } |
||
144 |