+14
src/squall.gleam
+14
src/squall.gleam
···
12
12
13
13
@target(erlang)
14
14
import simplifile
15
+
16
+
@target(erlang)
15
17
import squall/internal/codegen
18
+
19
+
@target(erlang)
16
20
import squall/internal/discovery
21
+
22
+
@target(erlang)
17
23
import squall/internal/error
24
+
25
+
@target(erlang)
18
26
import squall/internal/parser
27
+
28
+
@target(erlang)
19
29
import squall/internal/schema
20
30
21
31
@target(erlang)
···
213
223
|> result.map_error(fn(_) { "Failed to decode response data" })
214
224
}
215
225
226
+
@target(erlang)
216
227
pub fn main() {
217
228
case argv.load().arguments {
218
229
["generate", endpoint] -> generate(endpoint)
···
224
235
}
225
236
}
226
237
238
+
@target(erlang)
227
239
fn print_usage() {
228
240
io.println(
229
241
"
···
331
343
}
332
344
}
333
345
346
+
@target(erlang)
334
347
fn introspect_schema(endpoint: String) -> Result(schema.Schema, error.Error) {
335
348
// Build introspection query
336
349
let introspection_query =
···
409
422
schema.parse_introspection_response(response)
410
423
}
411
424
425
+
@target(erlang)
412
426
fn make_graphql_request(
413
427
endpoint: String,
414
428
query: String,
+8
src/squall/internal/discovery.gleam
+8
src/squall/internal/discovery.gleam
···
32
32
}
33
33
}
34
34
35
+
@target(javascript)
36
+
pub fn find_graphql_files(_root: String) -> Result(List(GraphQLFile), Error) {
37
+
Error(error.CannotReadFile(
38
+
"",
39
+
"File system access not available on JavaScript target",
40
+
))
41
+
}
42
+
35
43
/// Read a GraphQL file and extract its operation name
36
44
@target(erlang)
37
45
fn read_graphql_file(path: String) -> Result(GraphQLFile, Error) {