3 ms·
Wouldn't it be better to generate those structs from API schema?
by msoad 6y ago
Wouldn't it be better to generate those structs from API schema?
- yeneek 6y agoI have the same opinion. The big problem I had with generating graphql api from code, was that the result graphql schema was badly done. It's hard to design API that way. I made similar module for typescript just to realize, that I don't want to build graphql endpoints this way. that module: https://github.com/captain-refactor/graphql-compose-typescript https://github.com/captain-refactor/graphql-compose-typescri...
- harryf 6y agoYou mean something like https://github.com/banjun/WSDL2Swift https://github.com/banjun/WSDL2Swift ?
- maticzav 6y agoSwiftGraphQL also generates API structs from the schema. Maybe you are referring to generating the model from the queries. The problem we had with that approach was that it's hard to reuse the generated structures in your application model. You can read more about the idea here: https://github.com/maticzav/swift-graphql#what-are-the-pitfalls-in-apollo-ios-that-you-were-referring-to-at-the-top https://github.com/maticzav/swift-graphql#what-are-the-pitfa...