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

Feature: Support for runtime-only fields (data injected at runtime, not in DB) #48

Open
maoosi opened this issue Oct 26, 2022 · 0 comments
Assignees
Labels
is: feature request New feature request package: client Client package
Milestone

Comments

@maoosi
Copy link
Owner

maoosi commented Oct 26, 2022

query getPost {
  twitterShareUrl
}

query getUser {
  posts { twitterShareUrl }
}
return await prismaAppSync.resolve({
  event,
  runtime: {
    '**/{getPost,posts}/twitterShareUrl': {
      omit: ['twitterShareUrl'],
      select: { slug: true },
      inject: (post) => {
        const shareUrl = `https://myblog.com/${post.slug}`
        const twitterShareUrl = `https://twitter.com/intent/tweet?text=${shareUrl}`
        return { ...post, twitterShareUrl }
      }
    }
  }
})

Glob tester for runtime.

@maoosi maoosi added is: feature request New feature request package: client Client package labels Oct 26, 2022
@maoosi maoosi changed the title Feature: Support for runtime-only fields (data injected at runtime, not existing in DB) Feature: Support for runtime-only fields (data injected at runtime, not in DB) Oct 26, 2022
@maoosi maoosi added this to the 1.0.0-rc.7 milestone Jan 6, 2023
@maoosi maoosi self-assigned this Jan 6, 2023
@maoosi maoosi modified the milestones: 1.0.0-rc.7, 1.0.0-rc.8 Jul 6, 2023
@maoosi maoosi modified the milestones: 1.0.0-rc.8, 1.0.0-rc.9 Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is: feature request New feature request package: client Client package
Projects
Status: Planned
Development

No branches or pull requests

1 participant