Skip to content

Commit 5163824

Browse files
support graphqls schema extension (#480)
1 parent ef53897 commit 5163824

File tree

1 file changed

+2
-2
lines changed
  • graphql_client_codegen/src

1 file changed

+2
-2
lines changed

graphql_client_codegen/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ fn get_set_schema_from_file(schema_path: &std::path::Path) -> Schema {
8282
.unwrap_or("<no extension>");
8383
let schema_string = read_file(schema_path).unwrap();
8484
match schema_extension {
85-
"graphql" | "gql" => {
85+
"graphql" | "graphqls"| "gql" => {
8686
let s = graphql_parser::schema::parse_schema::<&str>(&schema_string).map_err(|parser_error| GeneralError(format!("Parser error: {}", parser_error))).unwrap();
8787
Schema::from(s)
8888
}
8989
"json" => {
9090
let parsed: graphql_introspection_query::introspection_response::IntrospectionResponse = serde_json::from_str(&schema_string).unwrap();
9191
Schema::from(parsed)
9292
}
93-
extension => panic!("Unsupported extension for the GraphQL schema: {} (only .json and .graphql are supported)", extension)
93+
extension => panic!("Unsupported extension for the GraphQL schema: {} (only .json, .graphql, .graphqls and .gql are supported)", extension)
9494
}
9595
})
9696
}

0 commit comments

Comments
 (0)