Skip to content

GraphQL support #17963

Closed
Closed
@klemenoslaj

Description

@klemenoslaj

🚀 Feature request

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Description

GraphQL support in Angular CLI is extremely limited or rather non existent. The big trouble for anyone trying to use Angular and GraphQL is that there is no way of pre-compile GraphQL documents. This way we end up with an extremely oversized bundles and increased script initialization.

There are solutions out there that compile GraphQL document into an AST:

None of the solutions listed above can be used effectively if we intend to develop library containing GraphQL.
With application alone we could theoretically make it work with graphql-tag/loader. Adding library into the mix will simply not work, as ng-packagr is completely closed to any custom Rollup loaders.

Similar ng-packagr issue: ng-packagr/ng-packagr#1619

Disclamer: I know the main issue is in ng-packagr, but I wanted to see what is the overall Angular CLI take on this, since Angular CLI is "blocked" by it indirectly.

Describe the solution you'd like

If the GraphQL is big enough in Angular it could become first class citizen.
If not (probably not), we would need some convenient way of adding loaders for both applications and libraries, as covering applications alone is only half of the story.

I know ng-packagr is a complete separate project, but that is exactly the problem here. While Angular CLI is getting more open with public APIs, ng-packagr is as closed as ever.

Describe alternatives you've considered

The only alternative I can think of is a fork of ng-packagr and a custom Angular CLI packagr builder to handle this not so special case. Either that or a complete abandonment of Angular CLI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions