Add top-level `context` to services
See original GitHub issueFrom my quick pseudo code from our call:
import { PrismaClient } from '@prisma/client'
import { RedwoodContext} from '@redwoodjs/api'
const db = new PrismaClient()
const context = new RedwoodContext()
export const posts = () => {
return db.post.findMany()
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Top-level statements - C# tutorial - Microsoft Learn
This tutorial shows how you can use top-level statements to experiment and prove concepts while exploring your ideas.
Read more >C# 9.0 Support for Top-level programs in Visual Studio 2019
NET 5 a new feature is getting introduced called "Top-level programs". This functionality takes away a lot of the boilerplate code necessary ...
Read more >Contexts - GitHub Docs
You can access context information in workflows and actions. ... github, object, The top-level context available during any job or step in a...
Read more >Compose file version 3 reference - Docker Documentation
Top-level keys that define a section in the configuration file such as build , deploy , depends_on ... version: "3.9" services: webapp: build:...
Read more >Creating a Windows Service with .NET 6
Windows services are programs that are automatically started when the system starts up, or when the user logs in. They run in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here’s a simple example that seems to work – adds indicated:
Now I’m trying to figure out how to get more info into the context from the client side.
@chris-hailstorm The
event
contains a bunch of useful things, but I think mostly the way of getting stuff from web -> api (especially authentication tokens) would be to add them to the headers of apollo graphql client.I need to look into how we do that via the Redwood Providers. It may not be technically possible right now, but I need to double check that.