Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macros - Converting circular structure to Bun AST #5271

Open
mathix420 opened this issue Sep 13, 2023 · 0 comments
Open

Macros - Converting circular structure to Bun AST #5271

mathix420 opened this issue Sep 13, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@mathix420
Copy link

mathix420 commented Sep 13, 2023

What is the problem this feature would solve?

Allow running JavaScript functions a Bundle-Time (Macros) that returns a circular structure.

Example, generating Neo4j GraphQL Schema and Neo4j OGM at build time (saving more than 2 sec of runtime!):

import { Neo4jGraphQLConstructor } from "@neo4j/graphql";
import { OGM } from "@neo4j/graphql-ogm";

const neoSchema: Neo4jGraphQLConstructor = {
    resolvers: {
        ...resolvers,
        ...scalars,
    },
    typeDefs: typeDefs,
    driver,
};

const ogm = new OGM(neoSchema);

export async function getSchemaOgm(): Promise<[GraphQLSchema, void]> {
    return Promise.all([neoSchema.getSchema(), ogm.init()]);
}

What is the feature you are proposing to solve the problem?

What alternatives have you considered?

No response

@mathix420 mathix420 added the enhancement New feature or request label Sep 13, 2023
@mathix420 mathix420 changed the title Converting circular structure to Bun AST Macros - Converting circular structure to Bun AST Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant