Apollo GraphQL Forum
1 FOLLOWERS
Welcome to the Apollo community forums, here you can connect with other developers and share knowledge about every part of the Apollo GraphQL platform. Discuss Apollo versions, Apollo client protocols, health check strategies, issues with the subscriptions, and more.
Apollo GraphQL Forum
16h ago
I’ve been trying for two weeks to get Apollo working with Meteor version 3. I need subscriptions, and I need a way for the server to see Meteor.userId() for authentication purposes.
Does anyone here have some ApolloClient and ApolloServer setup code they could post? It would be greatly appreciated ..read more
Apollo GraphQL Forum
16h ago
vikr00001:
const authLink = ApolloLink.from([
errorLink,
authLinkContext.concat(httpAuthLink),
]);
If I’m creating an authLink, is an errorLink required?
I’m planning to use it here:
export default new ApolloClient({
link: ApolloLink.split(
({ query }) => {
const definition = getMainDefinition(query);
return (
definition.kind === "OperationDefinition" &&
definition.operation === "subscription"
);
},
wsLink ? wsLink : appLink,
ApolloLink.split(
operation ..read more
Apollo GraphQL Forum
2d ago
Hi @xaviermorlot looks like you’re using GraphiQL, which is great. I think the issue may be due to your server. I recommend checking your browser developer tools and seeing whether there are any network errors, which may narrow down where to check next ..read more
Apollo GraphQL Forum
2d ago
Hi @vikr00001 I recommend taking a closer look at our Apollo Link documentation overall:
Apollo Docs
Apollo Link overview
Customize Apollo Client's data flow
Your errorLink variable is a string, where it should be an instance of ApolloLink. Hope that helps point you in the right direction ..read more
Apollo GraphQL Forum
2d ago
With this code:
let theWsLinkUrl = `wss://localhost:3000/graphql`
let appApiUrl = `http://localhost:3000/graphql`;
let errorLink = `http://localhost:3000/myPageThatShowsGraphQLerrors`;
const authLinkContext = setContext((_, { headers }) => {
// return the headers to the context so httpLink can read them
return {
headers: {
...headers,
authorization: token || "",
},
};
});
const authLink = ApolloLink.from([
errorLink,
authLinkContext.concat(httpAuthLink),
]);
…I’m getting an authLink that looks like this:
What am I missing ..read more
Apollo GraphQL Forum
2d ago
Hi,
I’m a beginner and i have this issue :
Can you help me to resolve it ?
Thank you very much ..read more
Apollo GraphQL Forum
2d ago
Hi,
I am trying to understand the best practices when using colocated fragments. I understand that one of the best practice is to ensure that each component is responsible for its own data requirements. If we have multiple components that needs the same field, should both field be redefined in each of the component’s colocated fragment? Also, if the parent component needs the same field as the child component, should that field be fetched in both the parent component and child component’s colocated fragment?
Example:
query X {
fieldA {
id
firstName
lastName ..read more
Apollo GraphQL Forum
3d ago
I’d like to create a public graph explorer for our API — similar to the Linear API found here: Linear API's Graph | GraphOS Studio
Note, the graph url endpoint is: Endpoint: https://api.linear.app/graphql
When I attempt to create one for Duro (our PLM application), I enter https://mfg.duro.app/graphql — but when I follow through in the wizard and enter it; it makes a supergraph; and gives me some cloud URL. https://current--duro-mfg.apollographos.net/graphql
This is not what I’m looking for.
I just want to share the graph for the URL I entered. How do I do this ..read more
Apollo GraphQL Forum
5d ago
Thank you so much! That worked. I have attached an image of the project structure for anyone who might be struggling with this. Regards, Calvin
By the way, after that I just clean the project using ShiftCommandK & OptionShiftCommandK ..read more