I'm using backend node server with the Apollo graphql (Server side) and on the client, I'm using Apollo Client as well.
I created a few client specific types in my client Schema for Apollo client but I'm wondering:
Should I do the same for backend Types (models)? Just to add some sanity, etc.
Let me explain it a bit detailed with an example:
Here is the client schema: (Client specific types)
import gql from 'graphql-tag';
export default gql`
type System {
showSignInModal: Boolean!
}
type Robot {
name: String!
status: String!
}
type Member {
name: String!
isLogged: Boolean!
}
type Author {
id: Int!
posts: Int!
name: String
}
input AuthorInput {
id: Int!
posts: Int!
name: String
}
`;
I have a query that fetches the user data from the server (Server specific data)
so should I describe the whole User type in my schema as well?
import gql from "graphql-tag";
export const GET_USER_SHORT_DATA = gql`
mutation getUserShortData {
me {
id,
email,
name,
profileUrl,
locale
}
}
`;
Thanks for any advice!