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

Schema is not pulled when using "--headers" #606

Closed
sdekna opened this issue Oct 14, 2022 · 11 comments
Closed

Schema is not pulled when using "--headers" #606

sdekna opened this issue Oct 14, 2022 · 11 comments
Labels
Bug Something isn't working like it should

Comments

@sdekna
Copy link

sdekna commented Oct 14, 2022

Describe the bug

I have a Hasura graphql server that requires headers x-hasura-admin-secret="$secret key"... However, when I try to initialize houdini with the --headers / -h necessary argument, it does not pull any schema. Tried headers with other clients and it works.
My command is like this: npx houdini init --headers x-hasura-admin-secret="$secret key"

The initialization process continues normally with no errors, but nothing is pulled... If I try npx houdini pull-schema it gives no error but doesn't pull the schema still`.

Any ideas?

Severity

blocking all usage of Houdini

Steps to Reproduce the Bug

1- start new project and install dependencies.
2- npx npx houdini init --headers x-hasura-admin-secret="$secret key"

Reproduction

No response

@AlecAivazis AlecAivazis added the Bug Something isn't working like it should label Oct 14, 2022
@AlecAivazis
Copy link
Collaborator

Thanks for reporting this @sdekna! I'll work on a fix this weekend

@AlecAivazis
Copy link
Collaborator

So i'm unable to reproduce this with #593 merged. I can't think of what exactly could have changed in that effort but it's very possible this isn't a problem any more. Mind trying again once 0.17.0 has been released? Shouldn't be too much longer now

@sdekna
Copy link
Author

sdekna commented Oct 16, 2022

Sure thing! 😄

@sdekna
Copy link
Author

sdekna commented Oct 16, 2022

Just to be sure I am not doing something wrong, this is how I am trying to pull the schema:

  • Tried during initialization with: npx houdini init -h x-hasura-admin-secret="key"
  • Tried after with: npx houdini pull-schema -h x-hasura-admin-secret="key"

Both give no errors but pull no schema nor types.
Houdini version: 0.16.8

@AlecAivazis
Copy link
Collaborator

yea that should work! I was seeing {"x-hasura-admin-secret": "key"} when I logged the headers being passed to fetch. I didn't check if I was seeing the same thing in the original code but we can debug what's going on if its still broken in a few days

@sdekna
Copy link
Author

sdekna commented Oct 17, 2022

excellent. Thanks for the support 🙏😁

@AlecAivazis
Copy link
Collaborator

Okay, 0.17.0 has been released - mind giving it a try @sdekna ?

@sdekna
Copy link
Author

sdekna commented Oct 21, 2022

Now its pulling schema perfectly 🙏
Works well with queries, however, for subscriptions when I use import { graphql, subscription } from '$houdini', it doesn't import it saying '"$houdini"' has no exported member named 'subscription'

@AlecAivazis
Copy link
Collaborator

That's because it was removed in 0.16.0. Now you can just use the graphql tag directly. I'm out to dinner so I can't grab a link to the docs but you should be able to see an example to copy there

@AlecAivazis
Copy link
Collaborator

Just got back. Here is the link to the subscription docs: https://www.houdinigraphql.com/api/subscription

@sdekna
Copy link
Author

sdekna commented Oct 22, 2022

amazing! everything looks good now... many thanks for the support man! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working like it should
Projects
None yet
Development

No branches or pull requests

2 participants