pasa
05/03/2018, 8:55 PMnew Prisma
statement in the index.js of the graphql server).
The playground is disabled (it should not be visible to anyone).
I have a managementApiSecret in the PRISMA_CONFIG, which is also in the .env to protect the deployment process (which is probably not necessary, as the container is running locally as mentioned earlier).
GraphQl server:
Standard graphql server using yoga.
The only thing of my api, that is actually exposed (accessible from outside), runs on the same machine, as the prisma server and accesses the service via localhost.
Currently only accessible via hostip.port
after being started with yarn start
, but will be set up as node.js server (w/ daemon) and managed via nginx. I will also setup a ssl cert for this and direct a subdomain (like api.example.com) of my maindomain to this server and route that trough to the port of the running node.js server.
What do you think?
Did I forget anything?
Should I pay attention to something?
Whats your opinion?
Thanks in advance! šKhoa Huynh
05/03/2018, 11:47 PMpsongpin
05/04/2018, 3:11 AMprisma init
in my folder, then chose the docker option with mysql. Then i run graphql create server
and it created a boilerplate for me. just confused why are there two config for these?damon.chen
05/04/2018, 3:11 AMuser
05/04/2018, 3:20 AMJim
05/04/2018, 6:03 AMuser
05/04/2018, 7:28 AMJim
05/04/2018, 7:45 AMtype Location {
id: ID! @unique
name: String!
machineName: String
}
My query in graphiql works:
query {
locations(
where: {
machineName: "paris"
}
) {
id
name
machineName
}
}
Ive added a new resolver:
type Query {
location: Location
feed: [Post!]!
drafts: [Post!]!
post(id: ID!): Post
locations: [Location!]!
me: User
}
And created the resolver:
location(parent, { machineName }, ctx, info) {
return ctx.db.query.location({ where: { machineName } }, info);
},
But I try to call it from React I get an error:
Network error: Response not successful: Received status code 400
export const LOCATION_QUERY = gql`
query LocationQuery {
location(where: { machineName: "paris" }) {
id
name
machineName
}
}
`;
john
05/04/2018, 8:22 AMpicosam
05/04/2018, 9:36 AMweakky
05/04/2018, 10:09 AMhoria.ancas
05/04/2018, 11:11 AMhoria.ancas
05/04/2018, 11:11 AMJim
05/04/2018, 11:44 AMJim
05/04/2018, 1:02 PMlocation(parent, args, ctx, info) {
const { machineName } = args;
return ctx.db.query.locations({ where: { machineName } }, info);
}
This query from the front-end:
{
location(machineName: "london") {
id
name
}
}
Will return:
{
"data": {
"location": [
{
"id": "cjgrqosbt5eum0b51hz4yqrou",
"name": "London"
}
]
}
}
But id like something like:
{
"data": {
"location" {
"id": "cjgrqosbt5eum0b51hz4yqrou",
"name": "London"
}
}
}
noahdavis
05/04/2018, 1:31 PMJim
05/04/2018, 1:46 PMshane
05/04/2018, 2:36 PM<Query query={MY_QUERY} fetchPolicy={'network-only'}>
or
<Query query={MY_QUERY} fetchPolicy="network-only">
medelman
05/04/2018, 2:36 PMexists
operation after upgrading to Prisma 1.7? Was the syntax somehow changed?
The following code, which used to work fine, now throws a TypeError: "cannot read property 'call' of undefined":
const exists = await ctx.db.exists.Media({ localSource })
pettanko
05/04/2018, 3:28 PMtheom
05/04/2018, 4:12 PMThe project could not be ejected because it has enabled integrations. Please migrate all integrations to resolvers first.
How do I 'migrate all integrations to resolvers'?lawjolla
05/04/2018, 5:26 PMrafaelcorreiapoli
05/04/2018, 10:48 PMrafaelcorreiapoli
05/04/2018, 10:52 PMrafaelcorreiapoli
05/04/2018, 10:53 PMmutation {
createAttachment(data:{
name: "teste",
description:"desc",
type: ARTICLE,
kind:WEB,
imageUrl:"<http://www.google.com>",
url:"<http://www.google.com>"
organizations:{
connect: [{
id: "cjgsibg858lms0b06p4a6lgj4"
}]
}
}) {
id
name
}
}
rafaelcorreiapoli
05/04/2018, 10:53 PMrafaelcorreiapoli
05/04/2018, 10:58 PMrafaelcorreiapoli
05/04/2018, 10:58 PMKhoa Huynh
05/05/2018, 12:06 AMJim
05/05/2018, 3:13 AMconst ME = gql`
query me {
me {
id
}
}
`;
<Query query={ME}>
{({ loading, error, data }) => {
if (loading) return <Loading />;
const userisLoggedIn = error ? false : true;
// Then I use userisLoggedIn to conditionally render stuff
It seems to work but Graphcool BaaS retunred null rather than an error when you queried for a logged in user. For some reason that felt more proper to me.