Type-safe GraphQL client generator for Gleam

mark elang only fns with erlang target

Changed files
+6
src
squall
internal
+2
src/squall.gleam
··· 247 247 ) 248 248 } 249 249 250 + @target(erlang) 250 251 fn generate_with_env() { 251 252 io.println("Error: GRAPHQL_ENDPOINT environment variable not set") 252 253 io.println("Usage: gleam run -m squall generate <endpoint>") 253 254 Nil 254 255 } 255 256 257 + @target(erlang) 256 258 fn generate(endpoint: String) { 257 259 io.println("🌊 Squall - GraphQL Code Generator") 258 260 io.println("================================\n")
+4
src/squall/internal/discovery.gleam
··· 12 12 } 13 13 14 14 /// Find all .gql files in graphql/ directories under the given root path 15 + @target(erlang) 15 16 pub fn find_graphql_files(root: String) -> Result(List(GraphQLFile), Error) { 16 17 case walk_directory(root) { 17 18 Ok(paths) -> { ··· 32 33 } 33 34 34 35 /// Read a GraphQL file and extract its operation name 36 + @target(erlang) 35 37 fn read_graphql_file(path: String) -> Result(GraphQLFile, Error) { 36 38 use operation_name <- result.try(extract_operation_name(path)) 37 39 use content <- result.try( ··· 127 129 } 128 130 129 131 /// Recursively walk a directory and return all file paths 132 + @target(erlang) 130 133 fn walk_directory(path: String) -> Result(List(String), simplifile.FileError) { 131 134 use is_dir <- result.try(simplifile.is_directory(path)) 132 135 ··· 145 148 } 146 149 } 147 150 151 + @target(erlang) 148 152 fn simplifile_error(err: simplifile.FileError) -> String { 149 153 case err { 150 154 simplifile.Enoent -> "File or directory not found"