Skip to content
This repository has been archived by the owner on Apr 23, 2022. It is now read-only.

Attain single source of truth between GraphQL schema and TypeScript types #5

Open
pospi opened this issue Jan 9, 2019 · 1 comment

Comments

@pospi
Copy link
Member

pospi commented Jan 9, 2019

It seems like there are ways to do this with pre-processing, which feel a bit weird, but which also seem to be workable. Allows us to get a single source of truth between frontend and backend types. There are potentially better options as TS and GraphQL are both continually evolving- more research needed.

If we do end up being able to compile the existing backend with AssemblyScript some day, it means we'll be able to share type information and base classes between the frontend and backend of the system, increasing code comprehension dramatically.

Even if we don't end up using any GFD code on the rusty-chain version, we can potentially get a head start on declaring the type system for integration with the Apollo / GraphQL view layer, which is an important aspect of authoring error-free UI code.

Either way, seems a win-win to attempt merging these two parts of the codebase.

@pospi pospi changed the title Investigate binding backend types to GraphQL API objects Attain single source of truth between GraphQL schema and TypeScript types Jan 16, 2019
@pospi
Copy link
Member Author

pospi commented Feb 5, 2019

FWIW the officially supported way of doing this is https://www.npmjs.com/package/apollo#code-generation

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant